Skip to content

Commit 67c08ce

Browse files
Nicolas PitreJunio C Hamano
authored andcommitted
pack-objects: remove redundent status information
The final 'nr_result' and 'written' values must always be the same otherwise we're in deep trouble. So let's remove a redundent report. And for paranoia sake let's make sure those two variables are actually equal after all objects are written (one never knows). Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 03f99c0 commit 67c08ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

builtin-pack-objects.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ static void write_pack_file(void)
514514
if (do_progress)
515515
fputc('\n', stderr);
516516
done:
517+
if (written != nr_result)
518+
die("wrote %d objects while expecting %d", written, nr_result);
517519
sha1close(f, pack_file_sha1, 1);
518520
}
519521

@@ -1662,7 +1664,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
16621664
}
16631665
}
16641666
if (progress)
1665-
fprintf(stderr, "Total %d, written %d (delta %d), reused %d (delta %d)\n",
1666-
nr_result, written, written_delta, reused, reused_delta);
1667+
fprintf(stderr, "Total %d (delta %d), reused %d (delta %d)\n",
1668+
written, written_delta, reused, reused_delta);
16671669
return 0;
16681670
}

0 commit comments

Comments
 (0)