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


C# Tree.AddEntry方法代碼示例

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


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

示例1: Test024_createCommitNonAscii

 public virtual void Test024_createCommitNonAscii()
 {
     ObjectId emptyId = InsertEmptyBlob();
     Tree almostEmptyTree = new Tree(db);
     almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, Sharpen.Runtime.GetBytesForString
         ("empty"), false));
     ObjectId almostEmptyTreeId = InsertTree(almostEmptyTree);
     NGit.CommitBuilder commit = new NGit.CommitBuilder();
     commit.TreeId = almostEmptyTreeId;
     commit.Author = new PersonIdent("Joe H\u00e4cker", "[email protected]", 4294967295000L
         , 60);
     commit.Committer = new PersonIdent("Joe Hacker", "[email protected]e.com", 4294967295000L
         , 60);
     commit.SetEncoding("ISO-8859-1");
     commit.Message = "\u00dcbergeeks";
     ObjectId cid = InsertCommit(commit);
     NUnit.Framework.Assert.AreEqual("2979b39d385014b33287054b87f77bcb3ecb5ebf", cid.Name
         );
 }
開發者ID:JamesChan,項目名稱:ngit,代碼行數:19,代碼來源:T0003_BasicTest.cs

示例2: Test022_createCommitTag

 public virtual void Test022_createCommitTag()
 {
     ObjectId emptyId = InsertEmptyBlob();
     Tree almostEmptyTree = new Tree(db);
     almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, Sharpen.Runtime.GetBytesForString
         ("empty"), false));
     ObjectId almostEmptyTreeId = InsertTree(almostEmptyTree);
     NGit.CommitBuilder almostEmptyCommit = new NGit.CommitBuilder();
     almostEmptyCommit.Author = new PersonIdent(author, 1154236443000L, -2 * 60);
     // not exactly the same
     almostEmptyCommit.Committer = new PersonIdent(author, 1154236443000L, -2 * 60);
     almostEmptyCommit.Message = "test022\n";
     almostEmptyCommit.TreeId = almostEmptyTreeId;
     ObjectId almostEmptyCommitId = InsertCommit(almostEmptyCommit);
     TagBuilder t = new TagBuilder();
     t.SetObjectId(almostEmptyCommitId, Constants.OBJ_COMMIT);
     t.SetTag("test022");
     t.SetTagger(new PersonIdent(author, 1154236443000L, -4 * 60));
     t.SetMessage("test022 tagged\n");
     ObjectId actid = InsertTag(t);
     NUnit.Framework.Assert.AreEqual("0ce2ebdb36076ef0b38adbe077a07d43b43e3807", actid
         .Name);
     RevTag mapTag = ParseTag(actid);
     NUnit.Framework.Assert.AreEqual(Constants.OBJ_COMMIT, mapTag.GetObject().Type);
     NUnit.Framework.Assert.AreEqual("test022 tagged\n", mapTag.GetFullMessage());
     NUnit.Framework.Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60),
         mapTag.GetTaggerIdent());
     NUnit.Framework.Assert.AreEqual("b5d3b45a96b340441f5abb9080411705c51cc86c", mapTag
         .GetObject().Id.Name);
 }
開發者ID:JamesChan,項目名稱:ngit,代碼行數:30,代碼來源:T0003_BasicTest.cs

示例3: Test023_createCommitNonAnullii

 public virtual void Test023_createCommitNonAnullii()
 {
     ObjectId emptyId = InsertEmptyBlob();
     Tree almostEmptyTree = new Tree(db);
     almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, Sharpen.Runtime.GetBytesForString
         ("empty"), false));
     ObjectId almostEmptyTreeId = InsertTree(almostEmptyTree);
     NGit.CommitBuilder commit = new NGit.CommitBuilder();
     commit.TreeId = almostEmptyTreeId;
     commit.Author = new PersonIdent("Joe H\u00e4cker", "[email protected]", 4294967295000L
         , 60);
     commit.Committer = new PersonIdent("Joe Hacker", "[email protected]", 4294967295000L
         , 60);
     commit.SetEncoding("UTF-8");
     commit.Message = "\u00dcbergeeks";
     ObjectId cid = InsertCommit(commit);
     NUnit.Framework.Assert.AreEqual("4680908112778718f37e686cbebcc912730b3154", cid.Name
         );
     RevCommit loadedCommit = ParseCommit(cid);
     NUnit.Framework.Assert.AreEqual(commit.Message, loadedCommit.GetFullMessage());
 }
開發者ID:JamesChan,項目名稱:ngit,代碼行數:21,代碼來源:T0003_BasicTest.cs

示例4: Test021_createTreeTag

 public virtual void Test021_createTreeTag()
 {
     ObjectId emptyId = InsertEmptyBlob();
     Tree almostEmptyTree = new Tree(db);
     almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, Sharpen.Runtime.GetBytesForString
         ("empty"), false));
     ObjectId almostEmptyTreeId = InsertTree(almostEmptyTree);
     TagBuilder t = new TagBuilder();
     t.SetObjectId(almostEmptyTreeId, Constants.OBJ_TREE);
     t.SetTag("test021");
     t.SetTagger(new PersonIdent(author, 1154236443000L, -4 * 60));
     t.SetMessage("test021 tagged\n");
     ObjectId actid = InsertTag(t);
     NUnit.Framework.Assert.AreEqual("b0517bc8dbe2096b419d42424cd7030733f4abe5", actid
         .Name);
     RevTag mapTag = ParseTag(actid);
     NUnit.Framework.Assert.AreEqual(Constants.OBJ_TREE, mapTag.GetObject().Type);
     NUnit.Framework.Assert.AreEqual("test021 tagged\n", mapTag.GetFullMessage());
     NUnit.Framework.Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60),
         mapTag.GetTaggerIdent());
     NUnit.Framework.Assert.AreEqual("417c01c8795a35b8e835113a85a5c0c1c77f67fb", mapTag
         .GetObject().Id.Name);
 }
開發者ID:JamesChan,項目名稱:ngit,代碼行數:23,代碼來源:T0003_BasicTest.cs


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