@@ -25,6 +25,8 @@ internal TreeEntryChanges(GitDiffDelta delta)
2525 OldMode = ( Mode ) delta . OldFile . Mode ;
2626 Oid = delta . NewFile . Id ;
2727 OldOid = delta . OldFile . Id ;
28+ Exists = ( delta . NewFile . Flags & GitDiffFlags . GIT_DIFF_FLAG_EXISTS ) != 0 ;
29+ OldExists = ( delta . OldFile . Flags & GitDiffFlags . GIT_DIFF_FLAG_EXISTS ) != 0 ;
2830
2931 Status = ( delta . Status == ChangeKind . Untracked || delta . Status == ChangeKind . Ignored )
3032 ? ChangeKind . Added
@@ -46,6 +48,17 @@ internal TreeEntryChanges(GitDiffDelta delta)
4648 /// </summary>
4749 public virtual ObjectId Oid { get ; private set ; }
4850
51+ /// <summary>
52+ /// The file exists in the new side of the diff.
53+ /// This is useful in determining if you have content in
54+ /// the ours or theirs side of a conflict. This will
55+ /// be false during a conflict that deletes both the
56+ /// "ours" and "theirs" sides, or when the diff is a
57+ /// delete and the status is
58+ /// <see cref="ChangeType.Deleted"/>.
59+ /// </summary>
60+ public virtual bool Exists { get ; private set ; }
61+
4962 /// <summary>
5063 /// The kind of change that has been done (added, deleted, modified ...).
5164 /// </summary>
@@ -66,6 +79,16 @@ internal TreeEntryChanges(GitDiffDelta delta)
6679 /// </summary>
6780 public virtual ObjectId OldOid { get ; private set ; }
6881
82+ /// <summary>
83+ /// The file exists in the old side of the diff.
84+ /// This is useful in determining if you have an ancestor
85+ /// side to a conflict. This will be false during a
86+ /// conflict that involves both the "ours" and "theirs"
87+ /// side being added, or when the diff is an add and the
88+ /// status is <see cref="ChangeType.Added"/>.
89+ /// </summary>
90+ public virtual bool OldExists { get ; private set ; }
91+
6992 private string DebuggerDisplay
7093 {
7194 get
0 commit comments