本文整理汇总了C#中NGit.Treewalk.FileTreeIterator.CompareMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# FileTreeIterator.CompareMetadata方法的具体用法?C# FileTreeIterator.CompareMetadata怎么用?C# FileTreeIterator.CompareMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit.Treewalk.FileTreeIterator
的用法示例。
在下文中一共展示了FileTreeIterator.CompareMetadata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例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));
}