Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions LibGit2Sharp/RepositoryStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Compat;
Expand All @@ -12,6 +13,7 @@ namespace LibGit2Sharp
/// Holds the result of the determination of the state of the working directory.
/// <para>Only files that differ from the current index and/or commit will be considered.</para>
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RepositoryStatus : IEnumerable<StatusEntry>
{
private readonly ICollection<StatusEntry> statusEntries;
Expand Down Expand Up @@ -173,5 +175,18 @@ public virtual bool IsDirty
{
get { return isDirty; }
}

private string DebuggerDisplay
{
get
{
return string.Format(
CultureInfo.InvariantCulture,
"+{0} ~{1} -{2} | +{3} ~{4} -{5} | i{6}",
Added.Count(), Staged.Count(), Removed.Count(),
Untracked.Count(), Modified.Count(), Missing.Count(),
Ignored.Count());
}
}
}
}
7 changes: 7 additions & 0 deletions LibGit2Sharp/StatusEntry.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using System.Diagnostics;
using LibGit2Sharp.Core;

namespace LibGit2Sharp
{
/// <summary>
/// Holds the calculated status of a particular file at a particular instant.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class StatusEntry : IEquatable<StatusEntry>
{
private readonly string filePath;
Expand Down Expand Up @@ -92,5 +94,10 @@ public override int GetHashCode()
{
return !Equals(left, right);
}

private string DebuggerDisplay
{
get { return string.Format("{0}: {1}", State, FilePath); }
}
}
}
2 changes: 1 addition & 1 deletion LibGit2Sharp/TreeChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
"Add: {0}, Del: {1}, Mod: {2}, Typ: {3}",
"+{0} ~{2} -{1} \u00B1{3}",
Added.Count(), Deleted.Count(),
Modified.Count(), TypeChanged.Count());
}
Expand Down