Documentation: rev-list-options: Fix -g paragraph formatting
[gitweb.git] / sha1_file.c
index 10346b681e3575d17945f64513e2b0fecbcc01fc..ff3bb493f8950918f9471b1402781f48f1e038ee 100644 (file)
@@ -2093,7 +2093,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");