• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Api.Git类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NGit.Api.Git的典型用法代码示例。如果您正苦于以下问题:C# Git类的具体用法?C# Git怎么用?C# Git使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Git类属于NGit.Api命名空间,在下文中一共展示了Git类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IdOffset

 public virtual void IdOffset()
 {
     Git git = new Git(db);
     WriteTrashFile("fileAinfsonly", "A");
     FilePath fileBinindex = WriteTrashFile("fileBinindex", "B");
     FsTick(fileBinindex);
     git.Add().AddFilepattern("fileBinindex").Call();
     WriteTrashFile("fileCinfsonly", "C");
     TreeWalk tw = new TreeWalk(db);
     DirCacheIterator indexIter = new DirCacheIterator(db.ReadDirCache());
     FileTreeIterator workTreeIter = new FileTreeIterator(db);
     tw.AddTree(indexIter);
     tw.AddTree(workTreeIter);
     workTreeIter.SetDirCacheIterator(tw, 0);
     AssertEntry("d46c305e85b630558ee19cc47e73d2e5c8c64cdc", "a,", tw);
     AssertEntry("58ee403f98538ec02409538b3f80adf610accdec", "a,b", tw);
     AssertEntry("0000000000000000000000000000000000000000", "a", tw);
     AssertEntry("b8d30ff397626f0f1d3538d66067edf865e201d6", "a0b", tw);
     // The reason for adding this test. Check that the id is correct for
     // mixed
     AssertEntry("8c7e5a667f1b771847fe88c01c3de34413a1b220", "fileAinfsonly", tw);
     AssertEntry("7371f47a6f8bd23a8fa1a8b2a9479cdd76380e54", "fileBinindex", tw);
     AssertEntry("96d80cd6c4e7158dbebd0849f4fb7ce513e5828c", "fileCinfsonly", tw);
     NUnit.Framework.Assert.IsFalse(tw.Next());
 }
开发者ID:red-gate,项目名称:ngit,代码行数:25,代码来源:FileTreeIteratorTest.cs


示例2: FailingPathsShouldNotResultInOKReturnValue

 public virtual void FailingPathsShouldNotResultInOKReturnValue()
 {
     FilePath folder1 = new FilePath(db.WorkTree, "folder1");
     FileUtils.Mkdir(folder1);
     FilePath file = new FilePath(folder1, "file1.txt");
     Write(file, "folder1--file1.txt");
     file = new FilePath(folder1, "file2.txt");
     Write(file, "folder1--file2.txt");
     Git git = new Git(db);
     git.Add().AddFilepattern(folder1.GetName()).Call();
     RevCommit @base = git.Commit().SetMessage("adding folder").Call();
     RecursiveDelete(folder1);
     git.Rm().AddFilepattern("folder1/file1.txt").AddFilepattern("folder1/file2.txt").
         Call();
     RevCommit other = git.Commit().SetMessage("removing folders on 'other'").Call();
     git.Checkout().SetName(@base.Name).Call();
     file = new FilePath(db.WorkTree, "unrelated.txt");
     Write(file, "unrelated");
     git.Add().AddFilepattern("unrelated").Call();
     RevCommit head = git.Commit().SetMessage("Adding another file").Call();
     // Untracked file to cause failing path for delete() of folder1
     file = new FilePath(folder1, "file3.txt");
     Write(file, "folder1--file3.txt");
     ResolveMerger merger = new ResolveMerger(db, false);
     merger.SetCommitNames(new string[] { "BASE", "HEAD", "other" });
     merger.SetWorkingTreeIterator(new FileTreeIterator(db));
     bool ok = merger.Merge(head.Id, other.Id);
     NUnit.Framework.Assert.IsFalse(merger.GetFailingPaths().IsEmpty());
     NUnit.Framework.Assert.IsFalse(ok);
 }
开发者ID:dprothero,项目名称:ngit,代码行数:30,代码来源:ResolveMergerTest.cs


示例3: TestSomeCommits

		public virtual void TestSomeCommits()
		{
			// do 4 commits
			Git git = new Git(db);
			git.Commit().SetMessage("initial commit").Call();
			git.Commit().SetMessage("second commit").SetCommitter(committer).Call();
			git.Commit().SetMessage("third commit").SetAuthor(author).Call();
			git.Commit().SetMessage("fourth commit").SetAuthor(author).SetCommitter(committer
				).Call();
			Iterable<RevCommit> commits = git.Log().Call();
			// check that all commits came in correctly
			PersonIdent defaultCommitter = new PersonIdent(db);
			PersonIdent[] expectedAuthors = new PersonIdent[] { defaultCommitter, committer, 
				author, author };
			PersonIdent[] expectedCommitters = new PersonIdent[] { defaultCommitter, committer
				, defaultCommitter, committer };
			string[] expectedMessages = new string[] { "initial commit", "second commit", "third commit"
				, "fourth commit" };
			int l = expectedAuthors.Length - 1;
			foreach (RevCommit c in commits)
			{
				NUnit.Framework.Assert.AreEqual(expectedAuthors[l].GetName(), c.GetAuthorIdent().
					GetName());
				NUnit.Framework.Assert.AreEqual(expectedCommitters[l].GetName(), c.GetCommitterIdent
					().GetName());
				NUnit.Framework.Assert.AreEqual(c.GetFullMessage(), expectedMessages[l]);
				l--;
			}
			NUnit.Framework.Assert.AreEqual(l, -1);
			ReflogReader reader = db.GetReflogReader(Constants.HEAD);
			NUnit.Framework.Assert.IsTrue(reader.GetLastEntry().GetComment().StartsWith("commit:"
				));
		}
开发者ID:shoff,项目名称:ngit,代码行数:33,代码来源:CommitAndLogCommandTests.cs


示例4: TestConflictingMergeFailsDueToDirtyIndex

 public virtual void TestConflictingMergeFailsDueToDirtyIndex()
 {
     Git git = new Git(db);
     FilePath fileA = WriteTrashFile("a", "a");
     RevCommit initialCommit = AddAllAndCommit(git);
     // switch branch
     CreateBranch(initialCommit, "refs/heads/side");
     CheckoutBranch("refs/heads/side");
     // modify file a
     Write(fileA, "a(side)");
     WriteTrashFile("b", "b");
     RevCommit sideCommit = AddAllAndCommit(git);
     // switch branch
     CheckoutBranch("refs/heads/master");
     // modify file a - this will cause a conflict during merge
     Write(fileA, "a(master)");
     WriteTrashFile("c", "c");
     AddAllAndCommit(git);
     // modify and add file a
     Write(fileA, "a(modified)");
     git.Add().AddFilepattern("a").Call();
     // do not commit
     // get current index state
     string indexState = IndexState(CONTENT);
     // merge
     MergeCommandResult result = git.Merge().Include(sideCommit.Id).SetStrategy(MergeStrategy
         .RESOLVE).Call();
     CheckMergeFailedResult(result, ResolveMerger.MergeFailureReason.DIRTY_INDEX, indexState
         , fileA);
 }
开发者ID:nnieslan,项目名称:ngit,代码行数:30,代码来源:MergeCommandTest.cs


示例5: TestLastModifiedTimes

		public virtual void TestLastModifiedTimes()
		{
			Git git = new Git(db);
			string path = "file";
			WriteTrashFile(path, "content");
			string path2 = "file2";
			WriteTrashFile(path2, "content2");
			git.Add().AddFilepattern(path).Call();
			git.Add().AddFilepattern(path2).Call();
			git.Commit().SetMessage("commit").Call();
			DirCache dc = db.ReadDirCache();
			DirCacheEntry entry = dc.GetEntry(path);
			DirCacheEntry entry2 = dc.GetEntry(path);
			NUnit.Framework.Assert.IsTrue(entry.LastModified != 0, "last modified shall not be zero!"
				);
			NUnit.Framework.Assert.IsTrue(entry2.LastModified != 0, "last modified shall not be zero!"
				);
			WriteTrashFile(path, "new content");
			git.Add().AddFilepattern(path).Call();
			git.Commit().SetMessage("commit2").Call();
			dc = db.ReadDirCache();
			entry = dc.GetEntry(path);
			entry2 = dc.GetEntry(path);
			NUnit.Framework.Assert.IsTrue(entry.LastModified != 0, "last modified shall not be zero!"
				);
			NUnit.Framework.Assert.IsTrue(entry2.LastModified != 0, "last modified shall not be zero!"
				);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:28,代码来源:IndexModificationTimesTest.cs


示例6: TestPush

		public virtual void TestPush()
		{
			// create other repository
			Repository db2 = CreateWorkRepository();
			// setup the first repository
			StoredConfig config = ((FileBasedConfig)db.GetConfig());
			RemoteConfig remoteConfig = new RemoteConfig(config, "test");
			URIish uri = new URIish(db2.Directory.ToURI().ToURL());
			remoteConfig.AddURI(uri);
			remoteConfig.Update(config);
			config.Save();
			Git git1 = new Git(db);
			// create some refs via commits and tag
			RevCommit commit = git1.Commit().SetMessage("initial commit").Call();
			Ref tagRef = git1.Tag().SetName("tag").Call();
			try
			{
				db2.Resolve(commit.Id.GetName() + "^{commit}");
				NUnit.Framework.Assert.Fail("id shouldn't exist yet");
			}
			catch (MissingObjectException)
			{
			}
			// we should get here
			RefSpec spec = new RefSpec("refs/heads/master:refs/heads/x");
			git1.Push().SetRemote("test").SetRefSpecs(spec).Call();
			NUnit.Framework.Assert.AreEqual(commit.Id, db2.Resolve(commit.Id.GetName() + "^{commit}"
				));
			NUnit.Framework.Assert.AreEqual(tagRef.GetObjectId(), db2.Resolve(tagRef.GetObjectId
				().GetName()));
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:31,代码来源:PushCommandTest.cs


示例7: NGitTransaction

        internal NGitTransaction(string path)
        {
            _path = path;
            _git = Git.Open(path);

            Clean();
        }
开发者ID:skovsboll,项目名称:Gandhi,代码行数:7,代码来源:NGitTransaction.cs


示例8: SetupRepository

		/// <exception cref="System.IO.IOException"></exception>
		/// <exception cref="NGit.Api.Errors.NoFilepatternException"></exception>
		/// <exception cref="NGit.Api.Errors.NoHeadException"></exception>
		/// <exception cref="NGit.Api.Errors.NoMessageException"></exception>
		/// <exception cref="NGit.Api.Errors.ConcurrentRefUpdateException"></exception>
		/// <exception cref="NGit.Api.Errors.JGitInternalException"></exception>
		/// <exception cref="NGit.Api.Errors.WrongRepositoryStateException"></exception>
		public virtual void SetupRepository()
		{
			// create initial commit
			git = new Git(db);
			initialCommit = git.Commit().SetMessage("initial commit").Call();
			// create file
			indexFile = new FilePath(db.WorkTree, "a.txt");
			FileUtils.CreateNewFile(indexFile);
			PrintWriter writer = new PrintWriter(indexFile);
			writer.Write("content");
			writer.Flush();
			// add file and commit it
			git.Add().AddFilepattern("a.txt").Call();
			secondCommit = git.Commit().SetMessage("adding a.txt").Call();
			prestage = DirCache.Read(db.GetIndexFile(), db.FileSystem).GetEntry(indexFile.GetName
				());
			// modify file and add to index
			writer.Write("new content");
			writer.Close();
			git.Add().AddFilepattern("a.txt").Call();
			// create a file not added to the index
			untrackedFile = new FilePath(db.WorkTree, "notAddedToIndex.txt");
			FileUtils.CreateNewFile(untrackedFile);
			PrintWriter writer2 = new PrintWriter(untrackedFile);
			writer2.Write("content");
			writer2.Close();
		}
开发者ID:shoff,项目名称:ngit,代码行数:34,代码来源:ResetCommandTest.cs


示例9: ResolveUnnamedCurrentBranchCommits

		public virtual void ResolveUnnamedCurrentBranchCommits()
		{
			Git git = new Git(db);
			WriteTrashFile("file.txt", "content");
			git.Add().AddFilepattern("file.txt").Call();
			RevCommit c1 = git.Commit().SetMessage("create file").Call();
			WriteTrashFile("file.txt", "content2");
			git.Add().AddFilepattern("file.txt").Call();
			RevCommit c2 = git.Commit().SetMessage("edit file").Call();
			NUnit.Framework.Assert.AreEqual(c2, db.Resolve("[email protected]{0}"));
			NUnit.Framework.Assert.AreEqual(c1, db.Resolve("[email protected]{1}"));
			git.Checkout().SetCreateBranch(true).SetName("newbranch").SetStartPoint(c1).Call(
				);
			// same as current branch, e.g. master
			NUnit.Framework.Assert.AreEqual(c1, db.Resolve("@{0}"));
			try
			{
				NUnit.Framework.Assert.AreEqual(c1, db.Resolve("@{1}"));
				NUnit.Framework.Assert.Fail();
			}
			catch (RevisionSyntaxException e)
			{
				// Looking at wrong ref, e.g HEAD
				NUnit.Framework.Assert.IsNotNull(e);
			}
			// detached head, read HEAD reflog
			git.Checkout().SetName(c2.GetName()).Call();
			NUnit.Framework.Assert.AreEqual(c2, db.Resolve("@{0}"));
			NUnit.Framework.Assert.AreEqual(c1, db.Resolve("@{1}"));
			NUnit.Framework.Assert.AreEqual(c2, db.Resolve("@{2}"));
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:31,代码来源:ReflogResolveTest.cs


示例10: TestTaggingOnHead

		public virtual void TestTaggingOnHead()
		{
			Git git = new Git(db);
			RevCommit commit = git.Commit().SetMessage("initial commit").Call();
			RevTag tag = git.Tag().SetName("tag").Call();
			NUnit.Framework.Assert.AreEqual(commit.Id, tag.GetObject().Id);
		}
开发者ID:shoff,项目名称:ngit,代码行数:7,代码来源:TagCommandTest.cs


示例11: Pull

		public ICommandResponse Pull (string path, string destPath)
		{
			var git = new Git(new FileRepository(ToGitDirString(path)));
			var pullCommand = git.Pull();
			ICommandResponse result = new NGitPullResultAdapter(pullCommand);
			return result;
		}
开发者ID:draptik,项目名称:RepoSync,代码行数:7,代码来源:NGitStrategy.cs


示例12: SetUp

 public override void SetUp()
 {
     base.SetUp();
     dbTarget = CreateWorkRepository();
     source = new Git(db);
     target = new Git(dbTarget);
     // put some file in the source repo
     sourceFile = new FilePath(db.WorkTree, "SomeFile.txt");
     WriteToFile(sourceFile, "Hello world");
     // and commit it
     source.Add().AddFilepattern("SomeFile.txt").Call();
     source.Commit().SetMessage("Initial commit for source").Call();
     // configure the target repo to connect to the source via "origin"
     StoredConfig targetConfig = ((FileBasedConfig)dbTarget.GetConfig());
     targetConfig.SetString("branch", "master", "remote", "origin");
     targetConfig.SetString("branch", "master", "merge", "refs/heads/master");
     RemoteConfig config = new RemoteConfig(targetConfig, "origin");
     config.AddURI(new URIish(source.GetRepository().WorkTree.GetPath()));
     config.AddFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/origin/*"));
     config.Update(targetConfig);
     targetConfig.Save();
     targetFile = new FilePath(dbTarget.WorkTree, "SomeFile.txt");
     // make sure we have the same content
     target.Pull().Call();
     target.Checkout().SetStartPoint("refs/remotes/origin/master").SetName("master").Call
         ();
     targetConfig.SetString("branch", "master", "merge", "refs/heads/master");
     targetConfig.SetBoolean("branch", "master", "rebase", true);
     targetConfig.Save();
     AssertFileContentsEqual(targetFile, "Hello world");
 }
开发者ID:nnieslan,项目名称:ngit,代码行数:31,代码来源:PullCommandWithRebaseTest.cs


示例13: CommitAfterSquashMerge

 public virtual void CommitAfterSquashMerge()
 {
     Git git = new Git(db);
     WriteTrashFile("file1", "file1");
     git.Add().AddFilepattern("file1").Call();
     RevCommit first = git.Commit().SetMessage("initial commit").Call();
     NUnit.Framework.Assert.IsTrue(new FilePath(db.WorkTree, "file1").Exists());
     CreateBranch(first, "refs/heads/branch1");
     CheckoutBranch("refs/heads/branch1");
     WriteTrashFile("file2", "file2");
     git.Add().AddFilepattern("file2").Call();
     git.Commit().SetMessage("second commit").Call();
     NUnit.Framework.Assert.IsTrue(new FilePath(db.WorkTree, "file2").Exists());
     CheckoutBranch("refs/heads/master");
     MergeCommandResult result = git.Merge().Include(db.GetRef("branch1")).SetSquash(true
         ).Call();
     NUnit.Framework.Assert.IsTrue(new FilePath(db.WorkTree, "file1").Exists());
     NUnit.Framework.Assert.IsTrue(new FilePath(db.WorkTree, "file2").Exists());
     NUnit.Framework.Assert.AreEqual(MergeStatus.FAST_FORWARD_SQUASHED, result.GetMergeStatus
         ());
     // comment not set, should be inferred from SQUASH_MSG
     RevCommit squashedCommit = git.Commit().Call();
     NUnit.Framework.Assert.AreEqual(1, squashedCommit.ParentCount);
     NUnit.Framework.Assert.IsNull(db.ReadSquashCommitMsg());
     NUnit.Framework.Assert.AreEqual("commit: Squashed commit of the following:", db.GetReflogReader
         (Constants.HEAD).GetLastEntry().GetComment());
     NUnit.Framework.Assert.AreEqual("commit: Squashed commit of the following:", db.GetReflogReader
         (db.GetBranch()).GetLastEntry().GetComment());
 }
开发者ID:OrangeCloudNetworks,项目名称:ngit,代码行数:29,代码来源:CommitCommandTest.cs


示例14: TestCherryPick

		public virtual void TestCherryPick()
		{
			Git git = new Git(db);
			WriteTrashFile("a", "first line\nsec. line\nthird line\n");
			git.Add().AddFilepattern("a").Call();
			RevCommit firstCommit = git.Commit().SetMessage("create a").Call();
			WriteTrashFile("b", "content\n");
			git.Add().AddFilepattern("b").Call();
			git.Commit().SetMessage("create b").Call();
			WriteTrashFile("a", "first line\nsec. line\nthird line\nfourth line\n");
			git.Add().AddFilepattern("a").Call();
			git.Commit().SetMessage("enlarged a").Call();
			WriteTrashFile("a", "first line\nsecond line\nthird line\nfourth line\n");
			git.Add().AddFilepattern("a").Call();
			RevCommit fixingA = git.Commit().SetMessage("fixed a").Call();
			git.BranchCreate().SetName("side").SetStartPoint(firstCommit).Call();
			CheckoutBranch("refs/heads/side");
			WriteTrashFile("a", "first line\nsec. line\nthird line\nfeature++\n");
			git.Add().AddFilepattern("a").Call();
			git.Commit().SetMessage("enhanced a").Call();
			git.CherryPick().Include(fixingA).Call();
			NUnit.Framework.Assert.IsFalse(new FilePath(db.WorkTree, "b").Exists());
			CheckFile(new FilePath(db.WorkTree, "a"), "first line\nsecond line\nthird line\nfeature++\n"
				);
			Iterator<RevCommit> history = git.Log().Call().Iterator();
			NUnit.Framework.Assert.AreEqual("fixed a", history.Next().GetFullMessage());
			NUnit.Framework.Assert.AreEqual("enhanced a", history.Next().GetFullMessage());
			NUnit.Framework.Assert.AreEqual("create a", history.Next().GetFullMessage());
			NUnit.Framework.Assert.IsFalse(history.HasNext());
		}
开发者ID:shoff,项目名称:ngit,代码行数:30,代码来源:CherryPickCommandTest.cs


示例15: TestAddUnstagedChanges

 public virtual void TestAddUnstagedChanges()
 {
     FilePath file = new FilePath(db.WorkTree, "a.txt");
     FileUtils.CreateNewFile(file);
     PrintWriter writer = new PrintWriter(file);
     writer.Write("content");
     writer.Close();
     Git git = new Git(db);
     git.Add().AddFilepattern("a.txt").Call();
     RevCommit commit = git.Commit().SetMessage("initial commit").Call();
     TreeWalk tw = TreeWalk.ForPath(db, "a.txt", commit.Tree);
     NUnit.Framework.Assert.AreEqual("6b584e8ece562ebffc15d38808cd6b98fc3d97ea", tw.GetObjectId
         (0).GetName());
     writer = new PrintWriter(file);
     writer.Write("content2");
     writer.Close();
     commit = git.Commit().SetMessage("second commit").Call();
     tw = TreeWalk.ForPath(db, "a.txt", commit.Tree);
     NUnit.Framework.Assert.AreEqual("6b584e8ece562ebffc15d38808cd6b98fc3d97ea", tw.GetObjectId
         (0).GetName());
     commit = git.Commit().SetAll(true).SetMessage("third commit").SetAll(true).Call();
     tw = TreeWalk.ForPath(db, "a.txt", commit.Tree);
     NUnit.Framework.Assert.AreEqual("db00fd65b218578127ea51f3dffac701f12f486a", tw.GetObjectId
         (0).GetName());
 }
开发者ID:dprothero,项目名称:ngit,代码行数:25,代码来源:CommitAndLogCommandTests.cs


示例16: TestRevert

		public virtual void TestRevert()
		{
			Git git = new Git(db);
			WriteTrashFile("a", "first line\nsec. line\nthird line\n");
			git.Add().AddFilepattern("a").Call();
			git.Commit().SetMessage("create a").Call();
			WriteTrashFile("b", "content\n");
			git.Add().AddFilepattern("b").Call();
			git.Commit().SetMessage("create b").Call();
			WriteTrashFile("a", "first line\nsec. line\nthird line\nfourth line\n");
			git.Add().AddFilepattern("a").Call();
			git.Commit().SetMessage("enlarged a").Call();
			WriteTrashFile("a", "first line\nsecond line\nthird line\nfourth line\n");
			git.Add().AddFilepattern("a").Call();
			RevCommit fixingA = git.Commit().SetMessage("fixed a").Call();
			WriteTrashFile("b", "first line\n");
			git.Add().AddFilepattern("b").Call();
			git.Commit().SetMessage("fixed b").Call();
			git.Revert().Include(fixingA).Call();
			NUnit.Framework.Assert.IsTrue(new FilePath(db.WorkTree, "b").Exists());
			CheckFile(new FilePath(db.WorkTree, "a"), "first line\nsec. line\nthird line\nfourth line\n"
				);
			Iterator<RevCommit> history = git.Log().Call().Iterator();
			RevCommit revertCommit = history.Next();
			string expectedMessage = "Revert \"fixed a\"\n\n" + "This reverts commit " + fixingA
				.Id.GetName() + ".\n";
			NUnit.Framework.Assert.AreEqual(expectedMessage, revertCommit.GetFullMessage());
			NUnit.Framework.Assert.AreEqual("fixed b", history.Next().GetFullMessage());
			NUnit.Framework.Assert.AreEqual("fixed a", history.Next().GetFullMessage());
			NUnit.Framework.Assert.AreEqual("enlarged a", history.Next().GetFullMessage());
			NUnit.Framework.Assert.AreEqual("create b", history.Next().GetFullMessage());
			NUnit.Framework.Assert.AreEqual("create a", history.Next().GetFullMessage());
			NUnit.Framework.Assert.IsFalse(history.HasNext());
		}
开发者ID:shoff,项目名称:ngit,代码行数:34,代码来源:RevertCommandTest.cs


示例17: Push

		public ICommandResponse Push (string path)
		{
			Git git = new Git(new FileRepository(ToGitDirString(path)));
			Iterable<PushResult> pushResults = git.Push().Call();
			ICommandResponse result = new NGitPushResultAdapter(pushResults);
			return result;
		}
开发者ID:draptik,项目名称:RepoSync,代码行数:7,代码来源:NGitStrategy.cs


示例18: TestMergeInItself

		public virtual void TestMergeInItself()
		{
			Git git = new Git(db);
			git.Commit().SetMessage("initial commit").Call();
			MergeCommandResult result = git.Merge().Include(db.GetRef(Constants.HEAD)).Call();
			NUnit.Framework.Assert.AreEqual(MergeStatus.ALREADY_UP_TO_DATE, result.GetMergeStatus
				());
		}
开发者ID:shoff,项目名称:ngit,代码行数:8,代码来源:MergeCommandTest.cs


示例19: DoCommit

 private static void DoCommit(Git repository, string message)
 {
     var commit = repository.Commit();
     commit.SetAuthor(GitHub.Username, "[email protected]");
     commit.SetMessage(message);
     commit.SetAll(true);
     commit.Call();
 }
开发者ID:QualityEnforcer,项目名称:QualityEnforcerBot,代码行数:8,代码来源:Program.cs


示例20: TestTagging

		public virtual void TestTagging()
		{
			Git git = new Git(db);
			git.Commit().SetMessage("initial commit").Call();
			RevCommit commit = git.Commit().SetMessage("second commit").Call();
			git.Commit().SetMessage("third commit").Call();
			Ref tagRef = git.Tag().SetObjectId(commit).SetName("tag").Call();
			NUnit.Framework.Assert.AreEqual(commit.Id, db.Peel(tagRef).GetPeeledObjectId());
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:9,代码来源:TagCommandTest.cs



注:本文中的NGit.Api.Git类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dircache.DirCacheEntry类代码示例发布时间:2022-05-26
下一篇:
C# NGit.Tree类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap