Skip to content

Commit

Permalink
don't set up callbacks if using cli git (#4128)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Jan 16, 2025
1 parent bc9fb21 commit 2609a94
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/GitTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,6 @@ function clone(io::IO, url, source_path; header=nothing, credentials=nothing, kw
printpkgstyle(io, :Cloning, header === nothing ? "git-repo `$url`" : header)
bar = MiniProgressBar(header = "Fetching:", color = Base.info_color())
fancyprint = can_fancyprint(io)
callbacks = if fancyprint
LibGit2.Callbacks(
:transfer_progress => (
@cfunction(transfer_progress, Cint, (Ptr{LibGit2.TransferProgress}, Any)),
bar,
)
)
else
LibGit2.Callbacks()
end
fancyprint && start_progress(io, bar)
if credentials === nothing
credentials = LibGit2.CachedCredentials()
Expand All @@ -121,6 +111,16 @@ function clone(io::IO, url, source_path; header=nothing, credentials=nothing, kw
end
return LibGit2.GitRepo(source_path)
else
callbacks = if fancyprint
LibGit2.Callbacks(
:transfer_progress => (
@cfunction(transfer_progress, Cint, (Ptr{LibGit2.TransferProgress}, Any)),
bar,
)
)
else
LibGit2.Callbacks()
end
mkpath(source_path)
return LibGit2.clone(url, source_path; callbacks=callbacks, credentials=credentials, kwargs...)
end
Expand Down

0 comments on commit 2609a94

Please sign in to comment.