author | Linus Torvalds <torvalds@linux-foundation.org> | |
Wed, 11 Jun 2008 01:47:18 +0000 (18:47 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 11 Jun 2008 05:23:18 +0000 (22:23 -0700) | ||
commit | e9039dd35194b7c1cf4ecd479928638166b8458f | |
tree | 546d1c2b4abc77de3b97eb0339afc33ea074ff6a | tree | snapshot |
parent | cdf222f5f0d6f2f22df12e83c4a1f9aae35f3084 | commit | diff |
Consolidate SHA1 object file close
This consolidates the common operations for closing the new temporary file
that we have written, before we move it into place with the final name.
There's some common code there (make it read-only and check for errors on
close), but more importantly, this also gives a single place to add an
fsync_or_die() call if we want to add a safe mode.
This was triggered due to Denis Bueno apparently twice being able to
corrupt his git repository on OS X due to an unlucky combination of kernel
crashes and a not-very-robust filesystem.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This consolidates the common operations for closing the new temporary file
that we have written, before we move it into place with the final name.
There's some common code there (make it read-only and check for errors on
close), but more importantly, this also gives a single place to add an
fsync_or_die() call if we want to add a safe mode.
This was triggered due to Denis Bueno apparently twice being able to
corrupt his git repository on OS X due to an unlucky combination of kernel
crashes and a not-very-robust filesystem.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c | diff | blob | history |