Skip to content

Commit b96289a

Browse files
ttaylorrgitster
authored andcommitted
pack-objects: include number of packs reused in output
In addition to including the number of objects reused verbatim from a reuse-pack, include the number of packs from which objects were reused. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ca0fd69 commit b96289a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

builtin/pack-objects.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ static struct progress *progress_state;
223223

224224
static struct bitmapped_pack *reuse_packfiles;
225225
static size_t reuse_packfiles_nr;
226+
static size_t reuse_packfiles_used_nr;
226227
static uint32_t reuse_packfile_objects;
227228
static struct bitmap *reuse_packfile_bitmap;
228229

@@ -1265,6 +1266,8 @@ static void write_pack_file(void)
12651266
for (j = 0; j < reuse_packfiles_nr; j++) {
12661267
reused_chunks_nr = 0;
12671268
write_reused_pack(&reuse_packfiles[j], f);
1269+
if (reused_chunks_nr)
1270+
reuse_packfiles_used_nr++;
12681271
}
12691272
offset = hashfile_total(f);
12701273
}
@@ -4587,9 +4590,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
45874590
fprintf_ln(stderr,
45884591
_("Total %"PRIu32" (delta %"PRIu32"),"
45894592
" reused %"PRIu32" (delta %"PRIu32"),"
4590-
" pack-reused %"PRIu32),
4593+
" pack-reused %"PRIu32" (from %"PRIuMAX")"),
45914594
written, written_delta, reused, reused_delta,
4592-
reuse_packfile_objects);
4595+
reuse_packfile_objects,
4596+
(uintmax_t)reuse_packfiles_used_nr);
45934597

45944598
cleanup:
45954599
clear_packing_data(&to_pack);

0 commit comments

Comments
 (0)