summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-19 12:38:50 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-19 12:38:54 -0700
commita4aefee46d48ed2070755aad7c505591000413c5 (patch)
tree1175bee3657120b03012fb89612db5252db396ff
parent3041b98a9d40e5eb1aae9698c7e15c85ff37f344 (diff)
parent33b650308c9be52180c6556b17cb9fc1fba3adf4 (diff)
downloadgit-a4aefee46d48ed2070755aad7c505591000413c5.tar.gz
Merge branch 'pb/rename-rowin32'
* pb/rename-rowin32: Do not rename read-only files during a push Looks-fine-to-me-by: Shawn O. Pearce <spearce@spearce.org> Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
-rw-r--r--index-pack.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/index-pack.c b/index-pack.c
index d3a4d31b4e..aec11cb940 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -790,7 +790,6 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
err = close(output_fd);
if (err)
die("error while closing pack file: %s", strerror(errno));
- chmod(curr_pack_name, 0444);
}
if (keep_msg) {
@@ -824,8 +823,9 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
if (move_temp_to_file(curr_pack_name, final_pack_name))
die("cannot store pack file");
}
+ if (from_stdin)
+ chmod(final_pack_name, 0444);
- chmod(curr_index_name, 0444);
if (final_index_name != curr_index_name) {
if (!final_index_name) {
snprintf(name, sizeof(name), "%s/pack/pack-%s.idx",
@@ -835,6 +835,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
if (move_temp_to_file(curr_index_name, final_index_name))
die("cannot store index file");
}
+ chmod(final_index_name, 0444);
if (!from_stdin) {
printf("%s\n", sha1_to_hex(sha1));