-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better warning information added `libgit2` tags
- Loading branch information
1 parent
dcac546
commit 52d72cb
Showing
4 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function tags(repo::GitRepo) | ||
with(StrArrayStruct()) do sa | ||
sa_ref = Ref(sa) | ||
@check ccall((:git_tag_list, :libgit2), Cint, | ||
(Ptr{StrArrayStruct}, Ptr{Void}), sa_ref, repo.ptr) | ||
convert(Vector{AbstractString}, sa_ref[]) | ||
end | ||
end | ||
|
||
function tag_delete(repo::GitRepo, tag::AbstractString) | ||
@check ccall((:git_tag_delete, :libgit2), Cint, | ||
(Ptr{Void}, Ptr{UInt8}, ), repo.ptr, tag) | ||
end | ||
|
||
function tag_create(repo::GitRepo, tag::AbstractString, commit::AbstractString; | ||
msg::AbstractString = "", | ||
force::Bool = false) | ||
oid_ptr = Ref(Oid()) | ||
with(get(GitCommit, repo, commit)) do commit_obj | ||
with(default_signature(repo)) do sig | ||
@check ccall((:git_tag_create, :libgit2), Cint, | ||
(Ptr{Oid}, Ptr{Void}, Ptr{UInt8}, Ptr{Void}, Ptr{SignatureStruct}, Ptr{UInt8}, Cint), | ||
oid_ptr, repo.ptr, tag, commit_obj.ptr, sig.ptr, msg, Cint(force)) | ||
end | ||
end | ||
return oid_ptr[] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters