path: root/fast-import.c
diff options
authorJohan Herland <>2009-03-26 15:16:47 (GMT)
committerJunio C Hamano <>2009-03-28 05:10:58 (GMT)
commitfb8b193670b0c11d118185332efc899d6d01d5f4 (patch)
tree1d25d46394067edd7833aeb70e714ebcbe6389c7 /fast-import.c
parent5a688fe4706462dfa0a7932ef0c82c335c47e9ab (diff)
Move chmod(foo, 0444) into move_temp_to_file()
When writing out a loose object or a pack (index), move_temp_to_file() is called to finalize the resulting file. These files (loose files and packs) should all have permission mode 0444 (modulo adjust_shared_perm()). Therefore, instead of doing chmod(foo, 0444) explicitly from each callsite (or even forgetting to chmod() at all), do the chmod() call from within move_temp_to_file(). Signed-off-by: Johan Herland <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'fast-import.c')
1 files changed, 0 insertions, 3 deletions
diff --git a/fast-import.c b/fast-import.c
index 3748ddf..d5fc042 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -902,9 +902,6 @@ static char *keep_pack(char *curr_index_name)
static const char *keep_msg = "fast-import";
int keep_fd;
- chmod(pack_data->pack_name, 0444);
- chmod(curr_index_name, 0444);
keep_fd = odb_pack_keep(name, sizeof(name), pack_data->sha1);
if (keep_fd < 0)
die("cannot create keep file");