当前位置: 首页>>代码示例>>C#>>正文


C# FileTreeIterator.SetDirCacheIterator方法代码示例

本文整理汇总了C#中NGit.Treewalk.FileTreeIterator.SetDirCacheIterator方法的典型用法代码示例。如果您正苦于以下问题:C# FileTreeIterator.SetDirCacheIterator方法的具体用法?C# FileTreeIterator.SetDirCacheIterator怎么用?C# FileTreeIterator.SetDirCacheIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NGit.Treewalk.FileTreeIterator的用法示例。


在下文中一共展示了FileTreeIterator.SetDirCacheIterator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:LunarLanding,项目名称:ngit,代码行数:25,代码来源:FileTreeIteratorTest.cs

示例2: TestDirCacheMatchingId

		public virtual void TestDirCacheMatchingId()
		{
			FilePath f = WriteTrashFile("file", "content");
			Git git = new Git(db);
			WriteTrashFile("file", "content");
			FsTick(f);
			git.Add().AddFilepattern("file").Call();
			DirCacheEntry dce = db.ReadDirCache().GetEntry("file");
			TreeWalk tw = new TreeWalk(db);
			FileTreeIterator fti = new FileTreeIterator(trash, db.FileSystem, ((FileBasedConfig
				)db.GetConfig()).Get(WorkingTreeOptions.KEY));
			tw.AddTree(fti);
			DirCacheIterator dci = new DirCacheIterator(db.ReadDirCache());
			tw.AddTree(dci);
			fti.SetDirCacheIterator(tw, 1);
			while (tw.Next() && !tw.PathString.Equals("file"))
			{
			}
			//
			NUnit.Framework.Assert.AreEqual(WorkingTreeIterator.MetadataDiff.EQUAL, fti.CompareMetadata
				(dce));
			ObjectId fromRaw = ObjectId.FromRaw(fti.IdBuffer, fti.IdOffset);
			NUnit.Framework.Assert.AreEqual("6b584e8ece562ebffc15d38808cd6b98fc3d97ea", fromRaw
				.GetName());
			NUnit.Framework.Assert.IsFalse(fti.IsModified(dce, false));
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:26,代码来源:FileTreeIteratorTest.cs


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