From 87a4a91727082c100a81db5c93b6154156e83338 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 15 Nov 2024 10:07:24 -0500 Subject: [PATCH] Actually switch to "Resolving Deltas" (#4080) Libgit2's "Resolving Deltas" code is extremely slow (https://github.com/libgit2/libgit2/issues/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. --- src/GitTools.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GitTools.jl b/src/GitTools.jl index d1d6551ebc..02fae614ea 100644 --- a/src/GitTools.jl +++ b/src/GitTools.jl @@ -11,6 +11,7 @@ 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) @@ -18,7 +19,10 @@ function transfer_progress(progress::Ptr{LibGit2.TransferProgress}, p::Any) 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