diff --git a/index-pack.c b/index-pack.c
index 75468228d3933cc86c79f3595f7ff5e6b643cd7b..6e93ee6af64593937ee9b078e599e81d40b74303 100644 (file)
--- a/index-pack.c
+++ b/index-pack.c
}
if (move_temp_to_file(curr_pack_name, final_pack_name))
die("cannot store pack file");
- }
- if (from_stdin)
+ } else if (from_stdin)
chmod(final_pack_name, 0444);
if (final_index_name != curr_index_name) {
}
if (move_temp_to_file(curr_index_name, final_index_name))
die("cannot store index file");
- }
- chmod(final_index_name, 0444);
+ } else
+ chmod(final_index_name, 0444);
if (!from_stdin) {
printf("%s\n", sha1_to_hex(sha1));