summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb8b193)
raw | patch | inline | side by side (parent: fb8b193)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 28 Mar 2009 06:14:39 +0000 (23:14 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 28 Mar 2009 15:01:21 +0000 (08:01 -0700) |
Now move_temp_to_file() is responsible for doing everything that is
necessary to turn a tempfile in $GIT_DIR into its final form, it must make
sure "Coda hack" codepath correctly makes the file read-only.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
necessary to turn a tempfile in $GIT_DIR into its final form, it must make
sure "Coda hack" codepath correctly makes the file read-only.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c | patch | blob | history |
diff --git a/sha1_file.c b/sha1_file.c
index 3bd20e715b785ab315e734c4ad5a18611e16cdf5..6f278593e5ecf6cfb4367fd0a3fd0b9eeefe9da6 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
*
* The same holds for FAT formatted media.
*
- * When this succeeds, we just return 0. We have nothing
+ * When this succeeds, we just return. We have nothing
* left to unlink.
*/
if (ret && ret != EEXIST) {
if (!rename(tmpfile, filename))
- return 0;
+ goto out;
ret = errno;
}
unlink(tmpfile);
/* FIXME!!! Collision check here ? */
}
+out:
if (chmod(filename, 0444) || adjust_shared_perm(filename))
return error("unable to set permission to '%s'", filename);
return 0;