summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d0b92a3)
raw | patch | inline | side by side (parent: d0b92a3)
author | Linus Torvalds <torvalds@linux-foundation.org> | |
Wed, 27 Aug 2008 19:48:00 +0000 (12:48 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Aug 2008 20:33:56 +0000 (13:33 -0700) |
The index-pack command, when processing a thin pack, fixed up the pack
after-the-fact. It forgets to fsync the result, because it only did that
in one path rather in all cases of fixup.
This moves the fsync_or_die() to the fix-up routine itself, rather than
doing it in one of the callers, so that all cases are covered.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
after-the-fact. It forgets to fsync the result, because it only did that
in one path rather in all cases of fixup.
This moves the fsync_or_die() to the fix-up routine itself, rather than
doing it in one of the callers, so that all cases are covered.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c | patch | blob | history | |
pack-write.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 2dadec1630c266bbaf42e84810f7059ed5c43b1e..d394c494a55d45a7af6506371f3432374dffe424 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
} else {
int fd = sha1close(f, NULL, 0);
fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written);
- fsync_or_die(fd, pack_tmp_name);
close(fd);
}
diff --git a/pack-write.c b/pack-write.c
index a8f02699366c87de960d7637e9f69c26c2241693..ddcfd37af263a5fe1009473cba879b00f4b6692d 100644 (file)
--- a/pack-write.c
+++ b/pack-write.c
SHA1_Final(pack_file_sha1, &c);
write_or_die(pack_fd, pack_file_sha1, 20);
+ fsync_or_die(pack_fd, pack_name);
}
char *index_pack_lockfile(int ip_out)