Skip to content

Commit 0418db6

Browse files
committed
Merge branch 'sg/unpack-progress-throughput' into next
"git unpack-objects" used to show progress based only on the number of received and unpacked objects, which stalled when it has to handle an unusually large object. It now shows the throughput as well. * sg/unpack-progress-throughput: builtin/unpack-objects.c: show throughput progress
2 parents 7736f98 + bae60ba commit 0418db6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/unpack-objects.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ static off_t consumed_bytes;
2424
static off_t max_input_size;
2525
static git_hash_ctx ctx;
2626
static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
27+
static struct progress *progress;
2728

2829
/*
2930
* When running under --strict mode, objects whose reachability are
@@ -92,6 +93,7 @@ static void use(int bytes)
9293
consumed_bytes += bytes;
9394
if (max_input_size && consumed_bytes > max_input_size)
9495
die(_("pack exceeds maximum allowed size"));
96+
display_throughput(progress, consumed_bytes);
9597
}
9698

9799
static void *get_data(unsigned long size)
@@ -484,7 +486,6 @@ static void unpack_one(unsigned nr)
484486
static void unpack_all(void)
485487
{
486488
int i;
487-
struct progress *progress = NULL;
488489
struct pack_header *hdr = fill(sizeof(struct pack_header));
489490

490491
nr_objects = ntohl(hdr->hdr_entries);

0 commit comments

Comments
 (0)