8000 Merge pull request #1167 from xoofx/add_debug_display_tree_entry · coding2233/libgit2sharp4unity3d@4d5cbbb · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d5cbbb

Browse files
committed
Merge pull request libgit2#1167 from xoofx/add_debug_display_tree_entry
Add DebuggerDisplay attribute to TreeEntry
2 parents f4a6001 + 7b0507e commit 4d5cbbb

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