8000 Add DebuggerDisplay attribute to TreeEntry · github/libgit2sharp@7b0507e · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit 7b0507e

Browse files
committed
Add DebuggerDisplay attribute to TreeEntry
1 parent f4a6001 commit 7b0507e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

LibGit2Sharp/TreeEntry.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.Globalization;
34
using System.Runtime.InteropServices;
45
using LibGit2Sharp.Core;
@@ -8,6 +9,7 @@ namespace LibGit2Sharp
89
/// <summary>
910
/// Representation of an entry in a <see cref="Tree"/>.
1011
/// </summary>
12+
[DebuggerDisplay("{DebuggerDisplay,nq}")]
1113
public class TreeEntry : IEquatable<TreeEntry>
1214
{
1315
private readonly ObjectId parentTreeId;
@@ -140,5 +142,16 @@ public override int GetHashCode()
140142
{
141143
return !Equals(left, right);
142144
}
145+
146+
private string DebuggerDisplay
147+
{
148+
get
149+
{
150+
return string.Format(CultureInfo.InvariantCulture,
151+
"TreeEntry: {0} => {1}",
152+
Path,
153+
TargetId);
154+
}
155+
}
143156
}
144157
}

0 commit comments

Comments
 (0)
0