diff options
Diffstat (limited to 'LibGit2Sharp/Repository.cs')
-rw-r--r-- | LibGit2Sharp/Repository.cs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs index 54707803..1840dd6b 100644 --- a/LibGit2Sharp/Repository.cs +++ b/LibGit2Sharp/Repository.cs @@ -392,7 +392,7 @@ namespace LibGit2Sharp /// <returns>The <see cref = "GitObject" /> or null if it was not found.</returns> public GitObject Lookup(ObjectId id) { - return LookupInternal(id, GitObjectType.Any, null); + return LookupInternal(id, Core.GitObjectType.Any, null); } /// <summary> @@ -402,7 +402,7 @@ namespace LibGit2Sharp /// <returns>The <see cref = "GitObject" /> or null if it was not found.</returns> public GitObject Lookup(string objectish) { - return Lookup(objectish, GitObjectType.Any, LookUpOptions.None); + return Lookup(objectish, Core.GitObjectType.Any, LookUpOptions.None); } /// <summary> @@ -433,12 +433,13 @@ namespace LibGit2Sharp /// <param name = "id">The id to lookup.</param> /// <param name = "type">The kind of GitObject being looked up</param> /// <returns>The <see cref = "GitObject" /> or null if it was not found.</returns> + [Obsolete("This method will be removed in the next release. Please use another Repository.Lookup() overload instead.")] public GitObject Lookup(ObjectId id, GitObjectType type = GitObjectType.Any) { - return LookupInternal(id, type, null); + return LookupInternal(id, type.ToCoreGitObjectType(), null); } - internal GitObject LookupInternal(ObjectId id, GitObjectType type, FilePath knownPath) + internal GitObject LookupInternal(ObjectId id, Core.GitObjectType type, FilePath knownPath) { Ensure.ArgumentNotNull(id, "id"); @@ -467,9 +468,10 @@ namespace LibGit2Sharp /// <param name = "objectish">A revparse spec for the object to lookup.</param> /// <param name = "type">The kind of <see cref = "GitObject" /> being looked up</param> /// <returns>The <see cref = "GitObject" /> or null if it was not found.</returns> + [Obsolete("This method will be removed in the next release. Please use another Repository.Lookup() overload instead.")] public GitObject Lookup(string objectish, GitObjectType type = GitObjectType.Any) { - return Lookup(objectish, type, LookUpOptions.None); + return Lookup(objectish, type.ToCoreGitObjectType(), LookUpOptions.None); } private static string PathFromRevparseSpec(string spec) @@ -488,7 +490,7 @@ namespace LibGit2Sharp return (m.Groups.Count > 1) ? m.Groups[1].Value : null; } - internal GitObject Lookup(string objectish, GitObjectType type, LookUpOptions lookUpOptions) + internal GitObject Lookup(string objectish, Core.GitObjectType type, LookUpOptions lookUpOptions) { Ensure.ArgumentNotNullOrEmptyString(objectish, "commitOrBranchSpec"); @@ -505,9 +507,9 @@ namespace LibGit2Sharp return null; } - GitObjectType objType = Proxy.git_object_type(sh); + Core.GitObjectType objType = Proxy.git_object_type(sh); - if (type != GitObjectType.Any && objType != type) + if (type != Core.GitObjectType.Any && objType != type) { return null; } @@ -531,7 +533,7 @@ namespace LibGit2Sharp /// <returns>The commit.</returns> internal Commit LookupCommit(string committish) { - return (Commit)Lookup(committish, GitObjectType.Any, LookUpOptions.ThrowWhenNoGitObjectHasBeenFound | LookUpOptions.DereferenceResultToCommit | LookUpOptions.ThrowWhenCanNotBeDereferencedToACommit); + return (Commit)Lookup(committish, Core.GitObjectType.Any, LookUpOptions.ThrowWhenNoGitObjectHasBeenFound | LookUpOptions.DereferenceResultToCommit | LookUpOptions.ThrowWhenCanNotBeDereferencedToACommit); } /// <summary> |