Skip to content

Commit

Permalink
Merge branch 'pb/rename-rowin32'
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gitster committed Oct 19, 2008
2 parents 3041b98 + 33b6503 commit a4aefee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index-pack.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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",
Expand All @@ -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));
Expand Down

0 comments on commit a4aefee

Please sign in to comment.