aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-05 13:32:57 -0700
committerJunio C Hamano <gitster@pobox.com>2017-07-05 13:32:57 -0700
commit8e90578ffbce029a09c2a56e95ba3009f27e4937 (patch)
tree73b227154ea7014f0d93fecc0e31e70102d75f2b /read-cache.c
parent5ab148dda0076a136b4afb385d96bd9cdc4d2590 (diff)
parent3ee83f48e5cfdfe2e3c783df1f3162e9383732fa (diff)
downloadgit-8e90578ffbce029a09c2a56e95ba3009f27e4937.tar.gz
git-8e90578ffbce029a09c2a56e95ba3009f27e4937.tar.xz
Merge branch 'cc/shared-index-permfix'
The split index code did not honor core.sharedrepository setting correctly. * cc/shared-index-permfix: t1700: make sure split-index respects core.sharedrepository t1301: move modebits() to test-lib-functions.sh read-cache: use shared perms when writing shared index
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) {