diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 4c2e0cd27cd6fb963adb2b5e572312869eae3f5d..447d492dbbfb578b8903293fa1d2a988eecfefac 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
* Did we write the wrong # entries in the header?
* If so, rewrite it like in fast-import
*/
- if (pack_to_stdout || nr_written == nr_remaining) {
- unsigned flags = pack_to_stdout ? CSUM_CLOSE : CSUM_FSYNC;
- sha1close(f, sha1, flags);
+ if (pack_to_stdout) {
+ sha1close(f, sha1, CSUM_CLOSE);
+ } else if (nr_written == nr_remaining) {
+ sha1close(f, sha1, CSUM_FSYNC);
} else {
int fd = sha1close(f, NULL, 0);
fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written);