aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 3c4354ee2..2121b6e7b 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2431,6 +2431,14 @@ static int write_shared_index(struct index_state *istate,
delete_tempfile(&temporary_sharedindex);
return ret;
}
+ ret = adjust_shared_perm(get_tempfile_path(&temporary_sharedindex));
+ if (ret) {
+ int save_errno = errno;
+ error("cannot fix permission bits on %s", get_tempfile_path(&temporary_sharedindex));
+ delete_tempfile(&temporary_sharedindex);
+ errno = save_errno;
+ return ret;
+ }
ret = rename_tempfile(&temporary_sharedindex,
git_path("sharedindex.%s", sha1_to_hex(si->base->sha1)));
if (!ret) {