Skip to content

Commit b7b793d

Browse files
avargitster
authored andcommitted
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 ae9af12 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48bf2fa commit b7b793d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

read-cache.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,8 +1584,7 @@ int refresh_index(struct index_state *istate, unsigned int flags,
15841584
t2_sum_scan += t2_did_scan;
15851585
if (new_entry == ce)
15861586
continue;
1587-
if (progress)
1588-
display_progress(progress, i);
1587+
display_progress(progress, i);
15891588
if (!new_entry) {
15901589
const char *fmt;
15911590

@@ -1620,10 +1619,8 @@ int refresh_index(struct index_state *istate, unsigned int flags,
16201619
trace2_data_intmax("index", NULL, "refresh/sum_lstat", t2_sum_lstat);
16211620
trace2_data_intmax("index", NULL, "refresh/sum_scan", t2_sum_scan);
16221621
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);
16271624
trace_performance_leave("refresh index");
16281625
return has_errors;
16291626
}

0 commit comments

Comments
 (0)