public void test017_SaveAllTags() { RemoteConfig rc = new RemoteConfig(db.Config, "origin"); rc.AddURI(new URIish("/some/dir")); rc.AddFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + rc.Name + "/*")); rc.SetTagOpt(TagOpt.FETCH_TAGS); rc.Update(db.Config); db.Config.Save(); checkFile(new FileInfo(Path.Combine(db.Directory.ToString(), "config")), "[core]\n" + "\trepositoryformatversion = 0\n" + "\tfilemode = true\n" + "[remote \"origin\"]\n" + "\turl = /some/dir\n" + "\tfetch = +refs/heads/*:refs/remotes/origin/*\n" + "\ttagopt = --tags\n"); }
public void test016_SaveNoTags() { RemoteConfig rc = new RemoteConfig(db.Config, "origin"); rc.AddURI(new URIish("/some/dir")); rc.AddFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + rc.Name + "/*")); rc.SetTagOpt(TagOpt.NO_TAGS); rc.Update(db.Config); db.Config.save(); checkFile(db.Config.getFile(), "[core]\n" + "\trepositoryformatversion = 0\n" + "\tfilemode = true\n" + "[remote \"origin\"]\n" + "\turl = /some/dir\n" + "\tfetch = +refs/heads/*:refs/remotes/origin/*\n" + "\ttagopt = --no-tags\n"); }
public void testSaveTimeout() { RemoteConfig rc = new RemoteConfig(config, "origin"); rc.AddURI(new URIish("/some/dir")); rc.AddFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + rc.Name + "/*")); rc.Timeout = 60; rc.Update(config); checkConfig("[remote \"origin\"]\n" + "\turl = /some/dir\n" + "\tfetch = +refs/heads/*:refs/remotes/origin/*\n" + "\ttimeout = 60\n"); }
private void saveRemote(URIish uri) { RemoteConfig rc = new RemoteConfig(db.Config, remoteName); rc.AddURI(uri); rc.AddFetchRefSpec(new RefSpec().SetForce(true).SetSourceDestination(Constants.R_HEADS + "*", Constants.R_REMOTES + remoteName + "/*")); rc.Update(db.Config); db.Config.save(); }
public void testSaveNoTags() { RemoteConfig rc = new RemoteConfig(config, "origin"); rc.AddURI(new URIish("/some/dir")); rc.AddFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + rc.Name + "/*")); rc.SetTagOpt(TagOpt.NO_TAGS); rc.Update(config); checkConfig("[remote \"origin\"]\n" + "\turl = /some/dir\n" + "\tfetch = +refs/heads/*:refs/remotes/origin/*\n" + "\ttagopt = --no-tags\n"); }