aboutsummaryrefslogtreecommitdiff
path: root/index-pack.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-30 08:42:16 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-31 14:46:57 -0700
commit4c81b03e30d13dbc93ea7071438ef2da0acd4189 (patch)
tree73459678fa41737c15a2957215d51bde97528ddf /index-pack.c
parentd2b3691b61d516a0ad2bf700a2a5d9113ceff0b1 (diff)
downloadgit-4c81b03e30d13dbc93ea7071438ef2da0acd4189.tar.gz
git-4c81b03e30d13dbc93ea7071438ef2da0acd4189.tar.xz
Make pack creation always fsync() the result
This means that we can depend on packs always being stable on disk, simplifying a lot of the object serialization worries. And unlike loose objects, serializing pack creation IO isn't going to be a performance killer. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'index-pack.c')
-rw-r--r--index-pack.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/index-pack.c b/index-pack.c
index aaba9443c..5ac91baf9 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -694,6 +694,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
if (!from_stdin) {
close(input_fd);
} else {
+ fsync_or_die(output_fd, curr_pack_name);
err = close(output_fd);
if (err)
die("error while closing pack file: %s", strerror(errno));