Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Commit.DebuggerDisplay

  • Loading branch information...
commit 874a47e84e3082a4a441dea0c57d0b6d5c31d340 1 parent f9f3740
@dahlbyk dahlbyk authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 LibGit2Sharp/Commit.cs
View
12 LibGit2Sharp/Commit.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Compat;
@@ -11,6 +13,7 @@ namespace LibGit2Sharp
/// <summary>
/// A Commit
/// </summary>
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Commit : GitObject
{
private readonly GitObjectLazyGroup group;
@@ -125,6 +128,15 @@ private static string RetrieveEncodingOf(GitObjectSafeHandle obj)
return encoding ?? "UTF-8";
}
+ private string DebuggerDisplay
+ {
+ get
+ {
+ return string.Format(CultureInfo.InvariantCulture,
+ "{0} {1}", Id.ToString(7), MessageShort);
+ }
+ }
+
private class ParentsCollection : ICollection<Commit>
{
private readonly Lazy<ICollection<Commit>> _parents;
Please sign in to comment.
Something went wrong with that request. Please try again.