本文整理汇总了C#中GitIndex.IsModified方法的典型用法代码示例。如果您正苦于以下问题:C# GitIndex.IsModified方法的具体用法?C# GitIndex.IsModified怎么用?C# GitIndex.IsModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitIndex
的用法示例。
在下文中一共展示了GitIndex.IsModified方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessEntry
/// <exception cref="System.IO.IOException"></exception>
internal virtual void ProcessEntry(TreeEntry h, TreeEntry m, GitIndex.Entry i)
{
ObjectId iId = (i == null ? null : i.GetObjectId());
ObjectId mId = (m == null ? null : m.GetId());
ObjectId hId = (h == null ? null : h.GetId());
string name = (i != null ? i.GetName() : (h != null ? h.GetFullName() : m.GetFullName
()));
if (i == null)
{
if (h == null)
{
updated.Put(name, mId);
}
else
{
if (m == null)
{
removed.AddItem(name);
}
else
{
updated.Put(name, mId);
}
}
}
else
{
if (h == null)
{
if (m == null || mId.Equals(iId))
{
if (HasParentBlob(merge, name))
{
if (i.IsModified(root, true))
{
conflicts.AddItem(name);
}
else
{
removed.AddItem(name);
}
}
}
else
{
conflicts.AddItem(name);
}
}
else
{
if (m == null)
{
if (hId.Equals(iId))
{
if (i.IsModified(root, true))
{
conflicts.AddItem(name);
}
else
{
removed.AddItem(name);
}
}
else
{
conflicts.AddItem(name);
}
}
else
{
if (!hId.Equals(mId) && !hId.Equals(iId) && !mId.Equals(iId))
{
conflicts.AddItem(name);
}
else
{
if (hId.Equals(iId) && !mId.Equals(iId))
{
if (i.IsModified(root, true))
{
conflicts.AddItem(name);
}
else
{
updated.Put(name, mId);
}
}
}
}
}
}
}
示例2: ProcessEntry
private void ProcessEntry(TreeEntry h, TreeEntry m, GitIndex.Entry i)
{
ObjectId iId = (i == null ? null : i.ObjectId);
ObjectId mId = (m == null ? null : m.Id);
ObjectId hId = (h == null ? null : h.Id);
string name = (i != null ? i.Name : (h != null ? h.FullName : m.FullName));
if (i == null)
{
//
// I (index) H M Result
// -------------------------------------------------------
// 0 nothing nothing nothing (does not happen)
// 1 nothing nothing exists use M
// 2 nothing exists nothing remove path from index
// 3 nothing exists exists use M
if (h == null)
{
_updated.Add(name, mId);
}
else if (m == null)
{
Removed.Add(name);
}
else
{
_updated.Add(name, mId);
}
}
else if (h == null)
{
//
// clean I==H I==M H M Result
// -----------------------------------------------------
// 4 yes N/A N/A nothing nothing keep index
// 5 no N/A N/A nothing nothing keep index
//
// 6 yes N/A yes nothing exists keep index
// 7 no N/A yes nothing exists keep index
// 8 yes N/A no nothing exists fail
// 9 no N/A no nothing exists fail
if (m == null || mId.Equals(iId))
{
if (HasParentBlob(_merge, name))
{
if (i.IsModified(_root, true))
{
Conflicts.Add(name);
}
else
{
Removed.Add(name);
}
}
}
else
{
Conflicts.Add(name);
}
}
else if (m == null)
{
//
// 10 yes yes N/A exists nothing remove path from index
// 11 no yes N/A exists nothing fail
// 12 yes no N/A exists nothing fail
// 13 no no N/A exists nothing fail
//
if (hId.Equals(iId))
{
if (i.IsModified(_root, true))
{
Conflicts.Add(name);
}
else
{
Removed.Add(name);
}
}
else
{
Conflicts.Add(name);
}
}
else
{
if (!hId.Equals(mId) && !hId.Equals(iId) && !mId.Equals(iId))
{
Conflicts.Add(name);
}
else if (hId.Equals(iId) && !mId.Equals(iId))
{
if (i.IsModified(_root, true))
{
Conflicts.Add(name);
}
//.........这里部分代码省略.........
示例3: VisitEntry
/// <exception cref="System.IO.IOException"></exception>
public override void VisitEntry(TreeEntry m, GitIndex.Entry i, FilePath f)
{
// TODO remove this once we support submodules
if (f.GetName().Equals(".gitmodules"))
{
throw new NotSupportedException(JGitText.Get().submodulesNotSupported);
}
if (m == null)
{
this._enclosing.index.Remove(this._enclosing.root, f);
return;
}
bool needsCheckout = false;
if (i == null)
{
needsCheckout = true;
}
else
{
if (i.GetObjectId().Equals(m.GetId()))
{
if (i.IsModified(this._enclosing.root, true))
{
needsCheckout = true;
}
}
else
{
needsCheckout = true;
}
}
if (needsCheckout)
{
GitIndex.Entry newEntry = this._enclosing.index.AddEntry(m);
this._enclosing.index.CheckoutEntry(this._enclosing.root, newEntry);
}
}