This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user