summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c283eb)
raw | patch | inline | side by side (parent: 5c283eb)
author | Petr Baudis <pasky@suse.cz> | |
Fri, 3 Oct 2008 10:20:43 +0000 (12:20 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 18 Oct 2008 14:16:38 +0000 (07:16 -0700) |
Win32 does not allow renaming read-only files (at least on a Samba
share), making push into a local directory to fail. Thus, defer
the chmod() call in index-pack.c:final() only after
move_temp_to_file() was called.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
share), making push into a local directory to fail. Thus, defer
the chmod() call in index-pack.c:final() only after
move_temp_to_file() was called.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
index-pack.c | patch | blob | history |
diff --git a/index-pack.c b/index-pack.c
index d3a4d31b4e92d69eb32d1a18ebb7be1f7470d1d1..aec11cb94066bc2d0fc75cad2b9f675c9d9bdb53 100644 (file)
--- a/index-pack.c
+++ b/index-pack.c
err = close(output_fd);
if (err)
die("error while closing pack file: %s", strerror(errno));
- chmod(curr_pack_name, 0444);
}
if (keep_msg) {
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",
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));