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


C# FileTreeIterator.IsModified方法代碼示例

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


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

示例1: TestIsModifiedSymlink

		public virtual void TestIsModifiedSymlink()
		{
			FilePath f = WriteTrashFile("symlink", "content");
			Git git = new Git(db);
			git.Add().AddFilepattern("symlink").Call();
			git.Commit().SetMessage("commit").Call();
			// Modify previously committed DirCacheEntry and write it back to disk
			DirCacheEntry dce = db.ReadDirCache().GetEntry("symlink");
			dce.FileMode = FileMode.SYMLINK;
			DirCacheCheckout.CheckoutEntry(db, f, dce);
			FileTreeIterator fti = new FileTreeIterator(trash, db.FileSystem, ((FileBasedConfig
				)db.GetConfig()).Get(WorkingTreeOptions.KEY));
			while (!fti.EntryPathString.Equals("symlink"))
			{
				fti.Next(1);
			}
			NUnit.Framework.Assert.IsFalse(fti.IsModified(dce, false));
		}
開發者ID:LunarLanding,項目名稱:ngit,代碼行數:18,代碼來源:FileTreeIteratorTest.cs

示例2: TestIsModifiedFileSmudged

		public virtual void TestIsModifiedFileSmudged()
		{
			FilePath f = WriteTrashFile("file", "content");
			Git git = new Git(db);
			// The idea of this test is to check the smudged handling
			// Hopefully fsTick will make sure our entry gets smudged
			FsTick(f);
			WriteTrashFile("file", "content");
			git.Add().AddFilepattern("file").Call();
			WriteTrashFile("file", "conten2");
			DirCacheEntry dce = db.ReadDirCache().GetEntry("file");
			FileTreeIterator fti = new FileTreeIterator(trash, db.FileSystem, ((FileBasedConfig
				)db.GetConfig()).Get(WorkingTreeOptions.KEY));
			while (!fti.EntryPathString.Equals("file"))
			{
				fti.Next(1);
			}
			// If the fsTick trick does not work we could skip the compareMetaData
			// test and hope that we are usually testing the intended code path.
			NUnit.Framework.Assert.AreEqual(WorkingTreeIterator.MetadataDiff.SMUDGED, fti.CompareMetadata
				(dce));
			NUnit.Framework.Assert.IsTrue(fti.IsModified(dce, false));
		}
開發者ID:LunarLanding,項目名稱:ngit,代碼行數:23,代碼來源:FileTreeIteratorTest.cs

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