8000 Add debugger display for RefSpec · pmiossec/libgit2sharp@439ee14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 439ee14

Browse files
committed
Add debugger display for RefSpec
1 parent 3b69bdb commit 439ee14

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

LibGit2Sharp/RefSpec.cs

Lines changed: 12 additions & 0 deletions
Or 8000 iginal file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Diagnostics;
3+
using System.Globalization;
24
using LibGit2Sharp.Core;
35
using LibGit2Sharp.Core.Handles;
46

@@ -7,6 +9,7 @@ namespace LibGit2Sharp
79
/// <summary>
810
/// A push or fetch reference specification
911
/// </summary>
12+
[DebuggerDisplay("{DebuggerDisplay,nq}")]
1013
public class RefSpec
1114
{
1215
private RefSpec(string refSpec, RefSpecDirection direction, string source, string destination, bool forceUpdate)
@@ -60,5 +63,14 @@ internal static RefSpec BuildFromPtr(GitRefSpecHandle handle)
6063
/// Indicates whether the destination will be force-updated if fast-forwarding is not possible
6164
/// </summary>
6265
public virtual bool ForceUpdate { get; private set; }
66+
67+
private string DebuggerDisplay
68+
{
69+
get
70+
{
71+
return string.Format(CultureInfo.InvariantCulture,
72+
"{0}", Specification);
73+
}
74+
}
6375
}
6476
}

0 commit comments

Comments
 (0)
0