本文整理汇总了C#中NGit.Dircache.DirCacheEntry.SetCreationTime方法的典型用法代码示例。如果您正苦于以下问题:C# DirCacheEntry.SetCreationTime方法的具体用法?C# DirCacheEntry.SetCreationTime怎么用?C# DirCacheEntry.SetCreationTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit.Dircache.DirCacheEntry
的用法示例。
在下文中一共展示了DirCacheEntry.SetCreationTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyMetaDataHelper
private void CopyMetaDataHelper(bool keepStage)
{
DirCacheEntry e = new DirCacheEntry("some/path", DirCacheEntry.STAGE_2);
e.IsAssumeValid = false;
e.SetCreationTime(2L);
e.FileMode = FileMode.EXECUTABLE_FILE;
e.LastModified = 3L;
e.SetLength(100L);
e.SetObjectId(ObjectId.FromString("0123456789012345678901234567890123456789"));
e.IsUpdateNeeded = true;
DirCacheEntry f = new DirCacheEntry("someother/path", DirCacheEntry.STAGE_1);
f.IsAssumeValid = true;
f.SetCreationTime(10L);
f.FileMode = FileMode.SYMLINK;
f.LastModified = 20L;
f.SetLength(100000000L);
f.SetObjectId(ObjectId.FromString("1234567890123456789012345678901234567890"));
f.IsUpdateNeeded = true;
e.CopyMetaData(f, keepStage);
NUnit.Framework.Assert.IsTrue(e.IsAssumeValid);
NUnit.Framework.Assert.AreEqual(10L, e.GetCreationTime());
NUnit.Framework.Assert.AreEqual(ObjectId.FromString("1234567890123456789012345678901234567890"
), e.GetObjectId());
NUnit.Framework.Assert.AreEqual(FileMode.SYMLINK, e.FileMode);
NUnit.Framework.Assert.AreEqual(20L, e.LastModified);
NUnit.Framework.Assert.AreEqual(100000000L, e.Length);
if (keepStage)
{
NUnit.Framework.Assert.AreEqual(DirCacheEntry.STAGE_2, e.Stage);
}
else
{
NUnit.Framework.Assert.AreEqual(DirCacheEntry.STAGE_1, e.Stage);
}
NUnit.Framework.Assert.IsTrue(e.IsUpdateNeeded);
NUnit.Framework.Assert.AreEqual("some/path", e.PathString);
}