path: root/pack-write.c
diff options
authorLinus Torvalds <>2008-08-27 19:48:00 (GMT)
committerJunio C Hamano <>2008-08-27 20:33:56 (GMT)
commit0c68d386da710940a22712b8f3539f7e73ba1b8f (patch)
tree212494452f9b31370c983bec9ab1286b54e005ae /pack-write.c
parentd0b92a3f6e4d98a38a86cbd86f0e39eea9005958 (diff)
index-pack: be careful after fixing up the header/footer
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pack-write.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/pack-write.c b/pack-write.c
index a8f0269..ddcfd37 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -179,6 +179,7 @@ void fixup_pack_header_footer(int pack_fd,
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)