File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,20 @@ typedef struct progress_data {
1818
1919static void print_progress (const progress_data * pd )
2020{
21- int network_percent = (100 * pd -> fetch_progress .received_objects ) / pd -> fetch_progress .total_objects ;
22- int index_percent = (100 * pd -> fetch_progress .indexed_objects ) / pd -> fetch_progress .total_objects ;
21+ int network_percent = pd -> fetch_progress .total_objects > 0 ?
22+ (100 * pd -> fetch_progress .received_objects ) / pd -> fetch_progress .total_objects :
23+ 0 ;
24+ int index_percent = pd -> fetch_progress .total_objects > 0 ?
25+ (100 * pd -> fetch_progress .indexed_objects ) / pd -> fetch_progress .total_objects :
26+ 0 ;
27+
2328 int checkout_percent = pd -> total_steps > 0
2429 ? (100 * pd -> completed_steps ) / pd -> total_steps
2530 : 0 ;
2631 int kbytes = pd -> fetch_progress .received_bytes / 1024 ;
2732
28- if (pd -> fetch_progress .received_objects == pd -> fetch_progress .total_objects ) {
33+ if (pd -> fetch_progress .total_objects &&
34+ pd -> fetch_progress .received_objects == pd -> fetch_progress .total_objects ) {
2935 printf ("Resolving deltas %d/%d\r" ,
3036 pd -> fetch_progress .indexed_deltas ,
3137 pd -> fetch_progress .total_deltas );
You can’t perform that action at this time.
0 commit comments