From 439ee14954e230d88a8950a30ae2958cccc1556f Mon Sep 17 00:00:00 2001 From: Aimeast Date: Mon, 2 Dec 2013 21:08:40 +0800 Subject: [PATCH] Add debugger display for RefSpec --- LibGit2Sharp/RefSpec.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/LibGit2Sharp/RefSpec.cs b/LibGit2Sharp/RefSpec.cs index 13f4cb3be..5534bd547 100644 --- a/LibGit2Sharp/RefSpec.cs +++ b/LibGit2Sharp/RefSpec.cs @@ -1,4 +1,6 @@ using System; +using System.Diagnostics; +using System.Globalization; using LibGit2Sharp.Core; using LibGit2Sharp.Core.Handles; @@ -7,6 +9,7 @@ namespace LibGit2Sharp /// /// A push or fetch reference specification /// + [DebuggerDisplay("{DebuggerDisplay,nq}")] public class RefSpec { private RefSpec(string refSpec, RefSpecDirection direction, string source, string destination, bool forceUpdate) @@ -60,5 +63,14 @@ internal static RefSpec BuildFromPtr(GitRefSpecHandle handle) /// Indicates whether the destination will be force-updated if fast-forwarding is not possible /// public virtual bool ForceUpdate { get; private set; } + + private string DebuggerDisplay + { + get + { + return string.Format(CultureInfo.InvariantCulture, + "{0}", Specification); + } + } } }