File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -81,16 +81,25 @@ impl File {
81
81
. map_err ( crate :: index:: traverse:: Error :: Processor ) ?;
82
82
83
83
let mut pack_traverse_outcomes = Vec :: new ( ) ;
84
+
85
+ progress. set_name ( "Validating" ) ;
86
+ let start = std:: time:: Instant :: now ( ) ;
87
+
88
+ progress. init (
89
+ Some ( self . num_indices as usize ) ,
90
+ git_features:: progress:: count ( "indices" ) ,
91
+ ) ;
84
92
for index_file_name in & self . index_names {
93
+ progress. inc ( ) ;
85
94
let bundle = crate :: Bundle :: at ( parent. join ( index_file_name) , self . object_hash )
86
95
. map_err ( integrity:: Error :: from)
87
96
. map_err ( crate :: index:: traverse:: Error :: Processor ) ?;
88
97
89
- progress. set_name ( index_file_name. display ( ) . to_string ( ) ) ;
98
+ let progress = progress . add_child ( index_file_name. display ( ) . to_string ( ) ) ;
90
99
let crate :: bundle:: verify:: integrity:: Outcome {
91
100
actual_index_checksum : _,
92
101
pack_traverse_outcome,
93
- progress : used_progress ,
102
+ progress : _ ,
94
103
} = bundle
95
104
. verify_integrity (
96
105
verify_mode,
@@ -135,9 +144,10 @@ impl File {
135
144
}
136
145
} ) ?;
137
146
pack_traverse_outcomes. push ( pack_traverse_outcome) ;
138
- progress = used_progress;
139
147
}
140
148
149
+ progress. show_throughput ( start) ;
150
+
141
151
Ok ( integrity:: Outcome {
142
152
actual_index_checksum,
143
153
pack_traverse_outcomes,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use git_repository::{
10
10
Progress ,
11
11
} ;
12
12
pub use index:: verify:: Mode ;
13
+ pub const PROGRESS_RANGE : std:: ops:: RangeInclusive < u8 > = 1 ..=3 ;
13
14
14
15
use crate :: OutputFormat ;
15
16
Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ pub fn main() -> Result<()> {
283
283
verbose,
284
284
progress,
285
285
progress_keep_open,
286
- None ,
286
+ verify :: PROGRESS_RANGE ,
287
287
move |progress, out, err| {
288
288
let mode = match ( decode, re_encode) {
289
289
( true , false ) => verify:: Mode :: HashCrc32Decode ,
You can’t perform that action at this time.
0 commit comments