read-cache.c: don't guard calls to progress.c API
Don't guard the calls to the progress.c API with "if (progress)". The API itself will check this. This doesn't change any behavior, but makes this code consistent with the rest of the codebase. See ae9af12287b (status: show progress bar if refreshing the index takes too long, 2018-09-15) for the commit that added the pattern we're changing here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jun 7, 2021 at 16:43 UTC
b7b793d1e7b1ec8104eef2da450ff47c02c9c365
1 file changed
+3
-6
read-cache.c
+3
-6
@@ -1584,8 +1584,7 @@ int refresh_index(struct index_state *istate, unsigned int flags,
1584
t2_sum_scan += t2_did_scan;
1585
if (new_entry == ce)
1586
continue;
1587
- if (progress)
1588
- display_progress(progress, i);
1587
+ display_progress(progress, i);
1588
if (!new_entry) {
1589
const char *fmt;
1590
@@ -1620,10 +1619,8 @@ int refresh_index(struct index_state *istate, unsigned int flags,
1619
trace2_data_intmax("index", NULL, "refresh/sum_lstat", t2_sum_lstat);
1620
trace2_data_intmax("index", NULL, "refresh/sum_scan", t2_sum_scan);
1621
trace2_region_leave("index", "refresh", NULL);
1623
- if (progress) {
1624
- display_progress(progress, istate->cache_nr);
1625
- stop_progress(&progress);
1626
- }
1622
+ display_progress(progress, istate->cache_nr);
1623
+ stop_progress(&progress);
1624
trace_performance_leave("refresh index");
1625
return has_errors;
1626
}