diff --git a/base/deprecated.jl b/base/deprecated.jl index d9b9e757b4818..aec18f7cf9082 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1522,4 +1522,7 @@ unsafe_wrap(::Type{String}, p::Cstring, len::Integer, own::Bool=false) = @deprecate finalize(sa::LibGit2.StrArrayStruct) close(sa) @deprecate finalize(sa::LibGit2.Buffer) close(sa) +# Rename LibGit2.GitAnyObject to LibGit2.GitUnknownObject (part of #19839) +eval(LibGit2, :(Base.@deprecate_binding GitAnyObject GitUnknownObject)) + # End deprecations scheduled for 0.6 diff --git a/base/libgit2/libgit2.jl b/base/libgit2/libgit2.jl index 2212a286ef86a..4a99e6e82c39e 100644 --- a/base/libgit2/libgit2.jl +++ b/base/libgit2/libgit2.jl @@ -284,7 +284,7 @@ function checkout!(repo::GitRepo, commit::AbstractString = ""; end # search for commit to get a commit object - obj = get(GitAnyObject, repo, Oid(commit)) + obj = get(GitUnknownObject, repo, Oid(commit)) obj === nothing && return try peeled = peel(obj, Consts.OBJ_COMMIT) @@ -341,7 +341,7 @@ end """ git reset [--soft | --mixed | --hard] """ function reset!(repo::GitRepo, commit::Oid, mode::Cint = Consts.RESET_MIXED) - obj = get(GitAnyObject, repo, commit) + obj = get(GitUnknownObject, repo, commit) # object must exist for reset obj === nothing && throw(GitError(Error.Object, Error.ERROR, "Commit `$(string(commit))` object not found")) try diff --git a/base/libgit2/reference.jl b/base/libgit2/reference.jl index 71ceb09195e71..d44355666d629 100644 --- a/base/libgit2/reference.jl +++ b/base/libgit2/reference.jl @@ -108,7 +108,7 @@ function peel{T <: GitObject}(::Type{T}, ref::GitReference) return Oid() elseif err != Int(Error.GIT_OK) if obj_ptr_ptr[] != C_NULL - close(GitAnyObject(ref.repo, obj_ptr_ptr[])) + close(GitUnknownObject(ref.repo, obj_ptr_ptr[])) end throw(Error.GitError(err)) end diff --git a/base/libgit2/repository.jl b/base/libgit2/repository.jl index 60fe43f0968c7..78e9c694203a4 100644 --- a/base/libgit2/repository.jl +++ b/base/libgit2/repository.jl @@ -74,7 +74,7 @@ function revparse(repo::GitRepo, objname::AbstractString) err = ccall((:git_revparse_single, :libgit2), Cint, (Ptr{Ptr{Void}}, Ptr{Void}, Cstring), obj_ptr_ptr, repo.ptr, objname) err != 0 && return nothing - return GitAnyObject(repo, obj_ptr_ptr[]) + return GitUnknownObject(repo, obj_ptr_ptr[]) end """ Returns id of a found object """ @@ -104,7 +104,7 @@ function get{T <: GitObject}(::Type{T}, repo::GitRepo, oid::Oid, oid_size::Int=O return nothing elseif err != Int(Error.GIT_OK) if obj_ptr_ptr[] != C_NULL - close(GitAnyObject(repo, obj_ptr_ptr[])) + close(GitUnknownObject(repo, obj_ptr_ptr[])) end throw(Error.GitError(err)) end @@ -134,7 +134,7 @@ function peel(obj::GitObject, obj_type::Cint) return Oid() elseif err != Int(Error.GIT_OK) if peeled_ptr_ptr[] != C_NULL - close(GitAnyObject(obj.repo, peeled_ptr_ptr[])) + close(GitUnknownObject(obj.repo, peeled_ptr_ptr[])) end throw(Error.GitError(err)) end diff --git a/base/libgit2/tree.jl b/base/libgit2/tree.jl index a814840c98ea5..b77e4c1052919 100644 --- a/base/libgit2/tree.jl +++ b/base/libgit2/tree.jl @@ -32,5 +32,5 @@ function object(repo::GitRepo, te::GitTreeEntry) @check ccall((:git_tree_entry_to_object, :libgit2), Cint, (Ptr{Ptr{Void}}, Ptr{Void}, Ref{Void}), obj_ptr_ptr, repo.ptr, te.ptr) - return GitAnyObject(repo, obj_ptr_ptr[]) + return GitUnknownObject(repo, obj_ptr_ptr[]) end diff --git a/base/libgit2/types.jl b/base/libgit2/types.jl index d42ca80708710..c616cb6004062 100644 --- a/base/libgit2/types.jl +++ b/base/libgit2/types.jl @@ -412,7 +412,7 @@ for (typ, reporef, sup, cname) in [ (:GitRebase, :GitRepo, :AbstractGitObject, :git_rebase), (:GitStatus, :GitRepo, :AbstractGitObject, :git_status_list), (:GitBranchIter, :GitRepo, :AbstractGitObject, :git_branch_iterator), - (:GitAnyObject, :GitRepo, :GitObject, :git_object), + (:GitUnknownObject, :GitRepo, :GitObject, :git_object), (:GitCommit, :GitRepo, :GitObject, :git_commit), (:GitBlob, :GitRepo, :GitObject, :git_blob), (:GitTree, :GitRepo, :GitObject, :git_tree), @@ -527,8 +527,8 @@ function getobjecttype{T<:GitObject}(::Type{T}) Consts.OBJ_BLOB elseif T == GitTag Consts.OBJ_TAG - elseif T == GitAnyObject - Consts.OBJ_ANY + elseif T == GitUnknownObject + Consts.OBJ_ANY # this name comes from the header else throw(GitError(Error.Object, Error.ENOTFOUND, "Type $T is not supported")) end @@ -543,8 +543,8 @@ function getobjecttype(obj_type::Cint) GitBlob elseif obj_type == Consts.OBJ_TAG GitTag - elseif obj_type == Consts.OBJ_ANY - GitAnyObject + elseif obj_type == Consts.OBJ_ANY #this name comes from the header + GitUnknownObject else throw(GitError(Error.Object, Error.ENOTFOUND, "Object type $obj_type is not supported")) end