1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
diff --git a/stdlib/LibGit2/src/types.jl b/stdlib/LibGit2/src/types.jl
index 9228bec175..b7f3fc46d8 100644
--- a/stdlib/LibGit2/src/types.jl
+++ b/stdlib/LibGit2/src/types.jl
@@ -237,6 +237,9 @@ Matches the [`git_remote_callbacks`](https://libgit2.org/libgit2/#HEAD/type/git_
@static if LibGit2.VERSION >= v"0.99.0"
resolve_url::Ptr{Cvoid} = C_NULL
end
+ @static if LibGit2.VERSION >= v"1.9.0"
+ update_refs::Ptr{Cvoid} = C_NULL
+ end
end
@assert Base.allocatedinline(RemoteCallbacks)
@@ -924,7 +927,9 @@ struct ConfigEntry
end
include_depth::Cuint
level::GIT_CONFIG
- free::Ptr{Cvoid}
+ @static if LibGit2.VERSION < v"1.9.0"
+ free::Ptr{Cvoid}
+ end
@static if LibGit2.VERSION < v"1.8.0"
# In 1.8.0, the unused payload value has been removed
payload::Ptr{Cvoid}
@@ -1151,18 +1156,27 @@ The fields represent:
equal to an oldest commit set in `options`).
"""
@kwdef struct BlameHunk
- lines_in_hunk::Csize_t = Csize_t(0)
+ lines_in_hunk::Csize_t = Csize_t(0)
- final_commit_id::GitHash = GitHash()
- final_start_line_number::Csize_t = Csize_t(0)
- final_signature::Ptr{SignatureStruct} = Ptr{SignatureStruct}(C_NULL)
+ final_commit_id::GitHash = GitHash()
+ final_start_line_number::Csize_t = Csize_t(0)
+ final_signature::Ptr{SignatureStruct} = Ptr{SignatureStruct}(C_NULL)
+ @static if LibGit2.VERSION >= v"1.9.0"
+ final_committer::Ptr{SignatureStruct} = Ptr{SignatureStruct}(C_NULL)
+ end
- orig_commit_id::GitHash = GitHash()
- orig_path::Cstring = Cstring(C_NULL)
- orig_start_line_number::Csize_t = Csize_t(0)
- orig_signature::Ptr{SignatureStruct} = Ptr{SignatureStruct}(C_NULL)
+ orig_commit_id::GitHash = GitHash()
+ orig_path::Cstring = Cstring(C_NULL)
+ orig_start_line_number::Csize_t = Csize_t(0)
+ orig_signature::Ptr{SignatureStruct} = Ptr{SignatureStruct}(C_NULL)
+ @static if LibGit2.VERSION >= v"1.9.0"
+ orig_committer::Ptr{SignatureStruct} = Ptr{SignatureStruct}(C_NULL)
+ end
- boundary::Char = '\0'
+ @static if LibGit2.VERSION >= v"1.9.0"
+ summary::Ptr{Char} = Ptr{Char}(C_NULL)
+ end
+ boundary::Char = '\0'
end
@assert Base.allocatedinline(BlameHunk)
diff --git a/stdlib/LibGit2/test/libgit2-tests.jl b/stdlib/LibGit2/test/libgit2-tests.jl
index 1dfa542936..b186f67c65 100644
--- a/stdlib/LibGit2/test/libgit2-tests.jl
+++ b/stdlib/LibGit2/test/libgit2-tests.jl
@@ -1152,6 +1152,7 @@ mktempdir() do dir
function setup_clone_repo(cache_repo::AbstractString, path::AbstractString; name="AAAA", email="BBBB@BBBB.COM")
repo = LibGit2.clone(cache_repo, path)
+ LibGit2.fetch(repo)
# need to set this for merges to succeed
cfg = LibGit2.GitConfig(repo)
LibGit2.set!(cfg, "user.name", name)
|