Skip to content

Commit

Permalink
Actually switch to "Resolving Deltas" (#4080)
Browse files Browse the repository at this point in the history
Libgit2's "Resolving Deltas" code is extremely slow (libgit2/libgit2#4674) on
larger repositories, so it is important to have an accurate progress bar to avoid users thinking
the download is stuck. We had this implemented. However, we were never actually switching to it,
because the progress meter thought the progress was jumping backwards and wouldn't actually update
because of it. Fix that by resetting it on the first switch to resolving deltas.
  • Loading branch information
Keno authored Nov 15, 2024
1 parent ef844e3 commit 87a4a91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/GitTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ import LibGit2
using Printf

use_cli_git() = Base.get_bool_env("JULIA_PKG_USE_CLI_GIT", false)
const RESOLVING_DELTAS_HEADER = "Resolving Deltas:"

function transfer_progress(progress::Ptr{LibGit2.TransferProgress}, p::Any)
progress = unsafe_load(progress)
@assert haskey(p, :transfer_progress)
bar = p[:transfer_progress]
@assert typeof(bar) == MiniProgressBar
if progress.total_deltas != 0
bar.header = "Resolving Deltas:"
if bar.header != RESOLVING_DELTAS_HEADER
bar.header = RESOLVING_DELTAS_HEADER
bar.prev = 0
end
bar.max = progress.total_deltas
bar.current = progress.indexed_deltas
else
Expand Down

0 comments on commit 87a4a91

Please sign in to comment.