當前位置: 首頁>>代碼示例>>C#>>正文


C# RevCommit.GetCommitterIdent方法代碼示例

本文整理匯總了C#中NGit.Revwalk.RevCommit.GetCommitterIdent方法的典型用法代碼示例。如果您正苦於以下問題:C# RevCommit.GetCommitterIdent方法的具體用法?C# RevCommit.GetCommitterIdent怎麽用?C# RevCommit.GetCommitterIdent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NGit.Revwalk.RevCommit的用法示例。


在下文中一共展示了RevCommit.GetCommitterIdent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ToCommit

 private static Commit ToCommit(RevCommit commit, Repository repository)
 {
     return new Commit
     (
         repository,
         commit.Name,
         commit.GetShortMessage(),
         ToPerson(commit.GetAuthorIdent()),
         ToPerson(commit.GetCommitterIdent()),
         commit.GetCommitterIdent().GetWhen(),
         commit.Parents.Select(p => p.Name)
     );
 }
開發者ID:dineshkummarc,項目名稱:Ometh,代碼行數:13,代碼來源:Repository.cs

示例2: ValidateStashedCommit

 /// <summary>Core validation to be performed on all stashed commits</summary>
 /// <param name="commit"></param>
 /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
 private void ValidateStashedCommit(RevCommit commit)
 {
     NUnit.Framework.Assert.IsNotNull(commit);
     Ref stashRef = db.GetRef(Constants.R_STASH);
     NUnit.Framework.Assert.IsNotNull(stashRef);
     NUnit.Framework.Assert.AreEqual(commit, stashRef.GetObjectId());
     NUnit.Framework.Assert.IsNotNull(commit.GetAuthorIdent());
     NUnit.Framework.Assert.AreEqual(commit.GetAuthorIdent(), commit.GetCommitterIdent
         ());
     NUnit.Framework.Assert.AreEqual(2, commit.ParentCount);
     // Load parents
     RevWalk walk = new RevWalk(db);
     try
     {
         foreach (RevCommit parent in commit.Parents)
         {
             walk.ParseBody(parent);
         }
     }
     finally
     {
         walk.Release();
     }
     NUnit.Framework.Assert.AreEqual(1, commit.GetParent(1).ParentCount);
     NUnit.Framework.Assert.AreEqual(head, commit.GetParent(1).GetParent(0));
     NUnit.Framework.Assert.IsFalse(commit.Tree.Equals(head.Tree), "Head tree matches stashed commit tree"
         );
     NUnit.Framework.Assert.AreEqual(head, commit.GetParent(0));
     NUnit.Framework.Assert.IsFalse(commit.GetFullMessage().Equals(commit.GetParent(1)
         .GetFullMessage()));
 }
開發者ID:kenji-tan,項目名稱:ngit,代碼行數:34,代碼來源:StashCreateCommandTest.cs

示例3: TestParse_NoParents

 public virtual void TestParse_NoParents()
 {
     ObjectId treeId = Id("9788669ad918b6fcce64af8882fc9a81cb6aba67");
     string authorName = "A U. Thor";
     string authorEmail = "[email protected]";
     int authorTime = 1218123387;
     string authorTimeZone = "+0700";
     string committerName = "C O. Miter";
     string committerEmail = "[email protected]";
     int committerTime = 1218123390;
     string committerTimeZone = "-0500";
     StringBuilder body = new StringBuilder();
     body.Append("tree ");
     body.Append(treeId.Name);
     body.Append("\n");
     body.Append("author ");
     body.Append(authorName);
     body.Append(" <");
     body.Append(authorEmail);
     body.Append("> ");
     body.Append(authorTime);
     body.Append(" ");
     body.Append(authorTimeZone);
     body.Append(" \n");
     body.Append("committer ");
     body.Append(committerName);
     body.Append(" <");
     body.Append(committerEmail);
     body.Append("> ");
     body.Append(committerTime);
     body.Append(" ");
     body.Append(committerTimeZone);
     body.Append("\n");
     body.Append("\n");
     RevWalk rw = new RevWalk(db);
     RevCommit c;
     c = new RevCommit(Id("9473095c4cb2f12aefe1db8a355fe3fafba42f67"));
     NUnit.Framework.Assert.IsNull(c.Tree);
     NUnit.Framework.Assert.IsNull(c.parents);
     c.ParseCanonical(rw, Sharpen.Runtime.GetBytesForString(body.ToString(), "UTF-8"));
     NUnit.Framework.Assert.IsNotNull(c.Tree);
     NUnit.Framework.Assert.AreEqual(treeId, c.Tree.Id);
     NUnit.Framework.Assert.AreSame(rw.LookupTree(treeId), c.Tree);
     NUnit.Framework.Assert.IsNotNull(c.parents);
     NUnit.Framework.Assert.AreEqual(0, c.parents.Length);
     NUnit.Framework.Assert.AreEqual(string.Empty, c.GetFullMessage());
     PersonIdent cAuthor = c.GetAuthorIdent();
     NUnit.Framework.Assert.IsNotNull(cAuthor);
     NUnit.Framework.Assert.AreEqual(authorName, cAuthor.GetName());
     NUnit.Framework.Assert.AreEqual(authorEmail, cAuthor.GetEmailAddress());
     NUnit.Framework.Assert.AreEqual((long)authorTime * 1000, cAuthor.GetWhen().GetTime
         ());
     NUnit.Framework.Assert.AreEqual(Sharpen.Extensions.GetTimeZone("GMT" + authorTimeZone
         ), cAuthor.GetTimeZone());
     PersonIdent cCommitter = c.GetCommitterIdent();
     NUnit.Framework.Assert.IsNotNull(cCommitter);
     NUnit.Framework.Assert.AreEqual(committerName, cCommitter.GetName());
     NUnit.Framework.Assert.AreEqual(committerEmail, cCommitter.GetEmailAddress());
     NUnit.Framework.Assert.AreEqual((long)committerTime * 1000, cCommitter.GetWhen().
         GetTime());
     NUnit.Framework.Assert.AreEqual(Sharpen.Extensions.GetTimeZone("GMT" + committerTimeZone
         ), cCommitter.GetTimeZone());
 }
開發者ID:charles-cai,項目名稱:ngit,代碼行數:63,代碼來源:RevCommitParseTest.cs

示例4: TestParse_incompleteAuthorAndCommitter

		public virtual void TestParse_incompleteAuthorAndCommitter()
		{
			StringBuilder b = new StringBuilder();
			b.Append("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n");
			b.Append("author <[email protected]> 1218123387 +0700\n");
			b.Append("committer <> 1218123390 -0500\n");
			RevCommit c;
			c = new RevCommit(Id("9473095c4cb2f12aefe1db8a355fe3fafba42f67"));
			c.ParseCanonical(new RevWalk(db), Sharpen.Runtime.GetBytesForString(b.ToString(), 
				"UTF-8"));
			NUnit.Framework.Assert.AreEqual(new PersonIdent(string.Empty, "[email protected]"
				, 1218123387000l, 7), c.GetAuthorIdent());
			NUnit.Framework.Assert.AreEqual(new PersonIdent(string.Empty, string.Empty, 1218123390000l
				, -5), c.GetCommitterIdent());
		}
開發者ID:LunarLanding,項目名稱:ngit,代碼行數:15,代碼來源:RevCommitParseTest.cs


注:本文中的NGit.Revwalk.RevCommit.GetCommitterIdent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。