diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-06-25 13:19:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-25 13:19:49 -0700 |
commit | abf7e0df170d957d973f74b08a898be114d1b228 (patch) | |
tree | a4a97f609c0d93a68e5cc44b38c24962d8ffade1 /sha1_file.c | |
parent | e4403d8bd3ccb6bcc3b6569012944d932334f5c4 (diff) | |
parent | aafe9fbaf4f1d1f27a6f6e3eb3e246fff81240ef (diff) | |
download | git-abf7e0df170d957d973f74b08a898be114d1b228.tar.gz git-abf7e0df170d957d973f74b08a898be114d1b228.tar.xz |
Merge branch 'lt/config-fsync'
* lt/config-fsync:
Add config option to enable 'fsync()' of object files
Split up default "i18n" and "branch" config parsing into helper routines
Split up default "user" config parsing into helper routine
Split up default "core" config parsing into helper routine
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c index e79b2c114..dd8327c94 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -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"); |