Skip to content

Commit

Permalink
Bump libgit2 to 0.99.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan committed Mar 23, 2020
1 parent d377785 commit fa4481b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions deps/libgit2.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LIBGIT2_BRANCH=v0.28.2
LIBGIT2_SHA1=b3e1a56ebb2b9291e82dc027ba9cbcfc3ead54d3
LIBGIT2_BRANCH=v0.99.0
LIBGIT2_SHA1=172239021f7ba04fe7327647b213799853a9eb89
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/LibGit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const REFCOUNT = Threads.Atomic{Int}(0)

function ensure_initialized end

include("error.jl")
include("utils.jl")
include("consts.jl")
include("types.jl")
include("error.jl")
include("signature.jl")
include("oid.jl")
include("reference.jl")
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/blob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ id = LibGit2.addblob!(repo, blob_file)
function addblob!(repo::GitRepo, path::AbstractString)
ensure_initialized()
id_ref = Ref{GitHash}()
@check ccall((:git_blob_create_fromdisk, :libgit2), Cint,
@check ccall((:git_blob_create_from_disk, :libgit2), Cint,
(Ptr{GitHash}, Ptr{Cvoid}, Cstring),
id_ref, repo.ptr, path)
return id_ref[]
Expand Down
15 changes: 12 additions & 3 deletions stdlib/LibGit2/src/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ export GitError
ECERTIFICATE = Cint(-17), # server certificate is invalid
EAPPLIED = Cint(-18), # patch/merge has already been applied
EPEEL = Cint(-19), # the requested peel operation is not possible
EEOF = Cint(-20), # Unexpted EOF
EEOF = Cint(-20), # unexpected EOF
PASSTHROUGH = Cint(-30), # internal only
ITEROVER = Cint(-31)) # signals end of iteration
ITEROVER = Cint(-31), # signals end of iteration
RETRY = Cint(-32), # internal only
EMISMATCH = Cint(-33), # hashsum mismatch in object
EINDEXDIRTY = Cint(-34), # unsaved changes in the index would be overwritten
EAPPLYFAIL = Cint(-35)) # patch application failed

@enum(Class, None,
NoMemory,
Expand Down Expand Up @@ -58,7 +62,12 @@ export GitError
Callback,
CherryPick,
Describe,
Rebase)
Rebase,
Filesystem,
Patch,
WorkTree,
SHA1,
HTTP)

struct ErrorStruct
message::Ptr{UInt8}
Expand Down
3 changes: 2 additions & 1 deletion stdlib/LibGit2/src/oid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function GitHash(ptr::Ptr{UInt8})
end
ensure_initialized()
oid_ptr = Ref(GitHash())
ccall((:git_oid_fromraw, :libgit2), Cvoid, (Ptr{GitHash}, Ptr{UInt8}), oid_ptr, ptr)
@check ccall((:git_oid_fromraw, :libgit2), Cint,
(Ptr{GitHash}, Ptr{UInt8}), oid_ptr, ptr)
return oid_ptr[]
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/repository.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end
function cleanup(r::GitRepo)
if r.ptr != C_NULL
ensure_initialized()
ccall((:git_repository__cleanup, :libgit2), Cvoid, (Ptr{Cvoid},), r.ptr)
@check ccall((:git_repository__cleanup, :libgit2), Cint, (Ptr{Cvoid},), r.ptr)
end
end

Expand Down
11 changes: 4 additions & 7 deletions stdlib/LibGit2/src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ end
LibGit2.TransferProgress
Transfer progress information used by the `transfer_progress` remote callback.
Matches the [`git_transfer_progress`](https://libgit2.org/libgit2/#HEAD/type/git_transfer_progress) struct.
Matches the [`git_indexer_progress`](https://libgit2.org/libgit2/#HEAD/type/git_indexer_progress) struct.
"""
@kwdef struct TransferProgress
total_objects::Cuint = Cuint(0)
Expand All @@ -223,6 +223,7 @@ end
push_negotiation::Ptr{Cvoid} = C_NULL
transport::Ptr{Cvoid} = C_NULL
payload::Ptr{Cvoid} = C_NULL
resolve_url::Ptr{Cvoid} = C_NULL
end

"""
Expand Down Expand Up @@ -325,12 +326,8 @@ end
prune::Cint = Consts.FETCH_PRUNE_UNSPECIFIED
update_fetchhead::Cint = Cint(1)
download_tags::Cint = Consts.REMOTE_DOWNLOAD_TAGS_AUTO
@static if LibGit2.VERSION >= v"0.25.0"
proxy_opts::ProxyOptions = ProxyOptions()
end
@static if LibGit2.VERSION >= v"0.24.0"
custom_headers::StrArrayStruct = StrArrayStruct()
end
proxy_opts::ProxyOptions = ProxyOptions()
custom_headers::StrArrayStruct = StrArrayStruct()
end

"""
Expand Down
4 changes: 2 additions & 2 deletions stdlib/LibGit2/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function version()
major = Ref{Cint}(0)
minor = Ref{Cint}(0)
patch = Ref{Cint}(0)
ccall((:git_libgit2_version, :libgit2), Cvoid,
(Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch)
@check ccall((:git_libgit2_version, :libgit2), Cint,
(Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch)
return VersionNumber(major[], minor[], patch[])
end
const VERSION = version()
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/walker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ end
function Base.sort!(w::GitRevWalker; by::Cint = Consts.SORT_NONE, rev::Bool=false)
ensure_initialized()
rev && (by |= Consts.SORT_REVERSE)
ccall((:git_revwalk_sorting, :libgit2), Cvoid, (Ptr{Cvoid}, Cint), w.ptr, by)
@check ccall((:git_revwalk_sorting, :libgit2), Cint, (Ptr{Cvoid}, Cint), w.ptr, by)
return w
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/test/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,7 @@ mktempdir() do dir
deserialize(f)
end
@test err.code == LibGit2.Error.ERROR
@test lowercase(err.msg) == lowercase("invalid Content-Type: text/plain")
@test lowercase(err.msg) == lowercase("invalid Content-Type: 'text/plain'")
end

# OpenSSL s_server should still be running
Expand Down

0 comments on commit fa4481b

Please sign in to comment.