]> asedeno.scripts.mit.edu Git - git.git/blobdiff - sha1_file.c
Merge branch 'tr/send-email-ssl'
[git.git] / sha1_file.c
index e79b2c1145e800e88c0f6e79338d2befa2443494..dd8327c941dd012d890fcb20313a3f0e682d1fa2 100644 (file)
@@ -2149,7 +2149,8 @@ int hash_sha1_file(const void *buf, unsigned long len, const char *type,
 /* Finalize a file on disk, and close it. */
 static void close_sha1_file(int fd)
 {
-       /* For safe-mode, we could fsync_or_die(fd, "sha1 file") here */
+       if (fsync_object_files)
+               fsync_or_die(fd, "sha1 file");
        fchmod(fd, 0444);
        if (close(fd) != 0)
                die("unable to write sha1 file");