summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-09-25 12:33:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-25 17:53:04 (GMT)
commitefdd2f0d4c4d6b1b1090171b6428919038bd2980 (patch)
treebdd19fe30ff16c402219f5ce37e2ad78bef50793 /midx.c
parent18e449f86b74bab35b150549c8342d252fe7ae00 (diff)
downloadgit-efdd2f0d4c4d6b1b1090171b6428919038bd2980.zip
git-efdd2f0d4c4d6b1b1090171b6428919038bd2980.tar.gz
git-efdd2f0d4c4d6b1b1090171b6428919038bd2980.tar.bz2
midx: use start_delayed_progress()
Now that the multi-pack-index may be written as part of auto maintenance at the end of a command, reduce the progress output when the operations are quick. Use start_delayed_progress() instead of start_progress(). Update t5319-multi-pack-index.sh to use GIT_PROGRESS_DELAY=0 now that the progress indicators are conditional. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/midx.c b/midx.c
index ef499cf..aa37d5d 100644
--- a/midx.c
+++ b/midx.c
@@ -832,7 +832,7 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
packs.pack_paths_checked = 0;
if (flags & MIDX_PROGRESS)
- packs.progress = start_progress(_("Adding packfiles to multi-pack-index"), 0);
+ packs.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0);
else
packs.progress = NULL;
@@ -969,7 +969,7 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
}
if (flags & MIDX_PROGRESS)
- progress = start_progress(_("Writing chunks to multi-pack-index"),
+ progress = start_delayed_progress(_("Writing chunks to multi-pack-index"),
num_chunks);
for (i = 0; i < num_chunks; i++) {
if (written != chunk_offsets[i])
@@ -1104,7 +1104,7 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
return 0;
if (flags & MIDX_PROGRESS)
- progress = start_progress(_("Looking for referenced packfiles"),
+ progress = start_delayed_progress(_("Looking for referenced packfiles"),
m->num_packs);
for (i = 0; i < m->num_packs; i++) {
if (prepare_midx_pack(r, m, i))
@@ -1225,7 +1225,7 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
count = xcalloc(m->num_packs, sizeof(uint32_t));
if (flags & MIDX_PROGRESS)
- progress = start_progress(_("Counting referenced objects"),
+ progress = start_delayed_progress(_("Counting referenced objects"),
m->num_objects);
for (i = 0; i < m->num_objects; i++) {
int pack_int_id = nth_midxed_pack_int_id(m, i);
@@ -1235,7 +1235,7 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
stop_progress(&progress);
if (flags & MIDX_PROGRESS)
- progress = start_progress(_("Finding and deleting unreferenced packfiles"),
+ progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"),
m->num_packs);
for (i = 0; i < m->num_packs; i++) {
char *pack_name;