using System.Diagnostics;
using System.Globalization;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
///
/// Holds the changes between two versions of a tree entry.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class TreeEntryChanges : Changes
{
///
/// Needed for mocking purposes.
///
protected TreeEntryChanges()
{ }
internal TreeEntryChanges(FilePath path, Mode mode, ObjectId oid, ChangeKind status, FilePath oldPath, Mode oldMode, ObjectId oldOid, bool isBinaryComparison)
{
Path = path.Native;
Mode = mode;
Oid = oid;
Status = status;
OldPath = oldPath.Native;
OldMode = oldMode;
OldOid = oldOid;
IsBinaryComparison = isBinaryComparison;
}
///
/// The new path.
///
public virtual string Path { get; private set; }
///
/// The new .
///
public virtual Mode Mode { get; private set; }
///
/// The new content hash.
///
public virtual ObjectId Oid { get; private set; }
///
/// The kind of change that has been done (added, deleted, modified ...).
///
public virtual ChangeKind Status { get; private set; }
///
/// The old path.
///
public virtual string OldPath { get; private set; }
///
/// The old .
///
public virtual Mode OldMode { get; private set; }
///
/// The old content hash.
///
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);
}
}
}
}