diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-04-16 22:00:54 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-04-16 22:02:22 +0400 |
commit | 1bf453d51d08cfb48269678f5fee4f980fa5115e (patch) | |
tree | f552631c6f9e712c9ae0be8dcf8c45f1f3767b6c /LibGit2Sharp/Reference.cs | |
parent | c897eab113eae2d4b36e645808dd67f2ec801ed1 (diff) |
Make Tags expose both their short name and canonical name
Diffstat (limited to 'LibGit2Sharp/Reference.cs')
-rw-r--r-- | LibGit2Sharp/Reference.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/LibGit2Sharp/Reference.cs b/LibGit2Sharp/Reference.cs index 8811e732..dcbcb596 100644 --- a/LibGit2Sharp/Reference.cs +++ b/LibGit2Sharp/Reference.cs @@ -10,9 +10,9 @@ namespace LibGit2Sharp public abstract class Reference : IEquatable<Reference> { /// <summary> - /// Gets the name of this reference. + /// Gets the full name of this reference. /// </summary> - public virtual string Name { get; protected set; } + public string CanonicalName { get; protected set; } #region IEquatable<Reference> Members @@ -33,7 +33,7 @@ namespace LibGit2Sharp return false; } - if (!Equals(Name, other.Name)) + if (!Equals(CanonicalName, other.CanonicalName)) { return false; } @@ -54,13 +54,13 @@ namespace LibGit2Sharp IntPtr resolveRef; NativeMethods.git_reference_resolve(out resolveRef, ptr); var reference = CreateFromPtr(resolveRef, repo); - return new SymbolicReference {Name = name, Target = reference}; + return new SymbolicReference {CanonicalName = name, Target = reference}; case GitReferenceType.Oid: var oidPtr = NativeMethods.git_reference_oid(ptr); var oid = (GitOid) Marshal.PtrToStructure(oidPtr, typeof (GitOid)); var target = repo.Lookup(new ObjectId(oid)); - return new DirectReference {Name = name, Target = target}; + return new DirectReference {CanonicalName = name, Target = target}; default: throw new InvalidOperationException(); @@ -78,7 +78,7 @@ namespace LibGit2Sharp unchecked { - hashCode = (hashCode*397) ^ Name.GetHashCode(); + hashCode = (hashCode*397) ^ CanonicalName.GetHashCode(); hashCode = (hashCode*397) ^ ProvideAdditionalEqualityComponent().GetHashCode(); } |