Merge branch 'main' of https://git.vhaudiquet.fr/vhaudiquet/pkh
All checks were successful
CI / build (push) Successful in 1m59s

* 'main' of https://git.vhaudiquet.fr/vhaudiquet/pkh:
  pull: explain progress
This commit is contained in:
2025-12-10 18:41:11 +01:00

View File

@@ -28,6 +28,7 @@ fn clone_repo(
let mut callbacks = git2::RemoteCallbacks::new();
if let Some(ref progress_cb) = progress {
// Download progress
callbacks.transfer_progress(move |stats| {
(progress_cb)(
"",
@@ -37,6 +38,9 @@ fn clone_repo(
);
true
});
// Remote progress: messages 'Remote: compressing objects 10% (34/340)'
// Parse progress informations to display them in callbacks
callbacks.sideband_progress(move |data| {
let msg = String::from_utf8_lossy(data);
let re = Regex::new(r"(.*):[ ]*([0-9]*)% \(([0-9]*)/([0-9]*)\)").unwrap();