diff options
author | Saaman <romain.magny@gmail.com> | 2013-04-26 18:44:47 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-04-26 22:28:30 +0400 |
commit | 9593179686b85c03743a6c434c21ce8b60e422ad (patch) | |
tree | 06a714c6679a5f65c2f11da1ff5cbe9cbb5fe1fd /LibGit2Sharp/TagCollection.cs | |
parent | 718a99e982175e4baf44829740e8d614566e33b6 (diff) |
Refactor handling of reference prefixes
Diffstat (limited to 'LibGit2Sharp/TagCollection.cs')
-rw-r--r-- | LibGit2Sharp/TagCollection.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/LibGit2Sharp/TagCollection.cs b/LibGit2Sharp/TagCollection.cs index 5e08e5fb..f05031c5 100644 --- a/LibGit2Sharp/TagCollection.cs +++ b/LibGit2Sharp/TagCollection.cs @@ -15,7 +15,6 @@ namespace LibGit2Sharp public class TagCollection : IEnumerable<Tag> { internal readonly Repository repo; - private const string refsTagsPrefix = "refs/tags/"; /// <summary> /// Needed for mocking purposes. @@ -126,24 +125,24 @@ namespace LibGit2Sharp { Ensure.ArgumentNotNullOrEmptyString(name, "name"); - if (name.StartsWith(refsTagsPrefix, StringComparison.Ordinal)) + if (name.StartsWith(Reference.TagPrefix, StringComparison.Ordinal)) { return name; } - return string.Concat(refsTagsPrefix, name); + return string.Concat(Reference.TagPrefix, name); } internal static string UnCanonicalizeName(string name) { Ensure.ArgumentNotNullOrEmptyString(name, "name"); - if (!name.StartsWith(refsTagsPrefix, StringComparison.Ordinal)) + if (!name.StartsWith(Reference.TagPrefix, StringComparison.Ordinal)) { return name; } - return name.Substring(refsTagsPrefix.Length); + return name.Substring(Reference.TagPrefix.Length); } private string DebuggerDisplay |