Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 4c2e0cd27c..447d492dbb 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -514,9 +514,10 @@ static void write_pack_file(void)
* 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);