@@ -5,11 +5,10 @@ use git2::{
5
5
WorktreeAddOptions ,
6
6
} ;
7
7
use snafu:: { ResultExt , Snafu } ;
8
- use tracing_indicatif:: span_ext:: IndicatifSpanExt ;
9
8
10
9
use crate :: {
11
10
error:: { self , CommitRef } ,
12
- utils:: { progress_bar_style , Quantizer } ,
11
+ utils:: setup_progress_tracking ,
13
12
} ;
14
13
15
14
#[ derive( Debug , Snafu ) ]
@@ -149,15 +148,11 @@ pub fn resolve_and_fetch_commitish(
149
148
error = & err as & dyn std:: error:: Error ,
150
149
"base commit not found locally, fetching from upstream"
151
150
) ;
152
- let span_recv = tracing:: info_span!( "receiving" ) ;
153
- let span_index = tracing:: info_span!( "indexing" ) ;
154
- span_recv. pb_set_style ( & progress_bar_style ( ) ) ;
155
- span_index. pb_set_style ( & progress_bar_style ( ) ) ;
156
- let _ = span_recv. enter ( ) ;
157
- let _ = span_index. enter ( ) ;
151
+
152
+ let ( span_recv, mut quant_recv) = setup_progress_tracking ( tracing:: info_span!( "receiving" ) ) ;
153
+ let ( span_index, mut quant_index) = setup_progress_tracking ( tracing:: info_span!( "indexing" ) ) ;
154
+
158
155
let mut callbacks = RemoteCallbacks :: new ( ) ;
159
- let mut quant_recv = Quantizer :: percent ( ) ;
160
- let mut quant_index = Quantizer :: percent ( ) ;
161
156
callbacks. transfer_progress ( move |progress| {
162
157
quant_recv. update_span_progress (
163
158
progress. received_objects ( ) ,
@@ -171,6 +166,7 @@ pub fn resolve_and_fetch_commitish(
171
166
) ;
172
167
true
173
168
} ) ;
169
+
174
170
repo. remote_anonymous ( upstream_url)
175
171
. context ( CreateRemoteSnafu {
176
172
repo,
0 commit comments