1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
using System.Diagnostics;
using System.Globalization;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// Holds the changes between two versions of a tree entry.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class TreeEntryChanges
{
/// <summary>
/// Needed for mocking purposes.
/// </summary>
protected TreeEntryChanges()
{ }
internal TreeEntryChanges(FilePath path, Mode mode, ObjectId oid, ChangeKind status, FilePath oldPath, Mode oldMode, ObjectId oldOid)
{
Path = path.Native;
Mode = mode;
Oid = oid;
Status = status;
OldPath = oldPath.Native;
OldMode = oldMode;
OldOid = oldOid;
}
/// <summary>
/// The new path.
/// </summary>
public virtual string Path { get; private set; }
/// <summary>
/// The new <see cref="Mode"/>.
/// </summary>
public virtual Mode Mode { get; private set; }
/// <summary>
/// The new content hash.
/// </summary>
public virtual ObjectId Oid { get; private set; }
/// <summary>
/// The kind of change that has been done (added, deleted, modified ...).
/// </summary>
public virtual ChangeKind Status { get; private set; }
/// <summary>
/// The old path.
/// </summary>
public virtual string OldPath { get; private set; }
/// <summary>
/// The old <see cref="Mode"/>.
/// </summary>
public virtual Mode OldMode { get; private set; }
/// <summary>
/// The old content hash.
/// </summary>
public virtual ObjectId OldOid { get; private set; }
private string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
"Path = {0}, File {1}",
!string.IsNullOrEmpty(Path) ? Path : OldPath, Status);
}
}
}
}
|