summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-10 13:59:05 -0700
committerJunio C Hamano <gitster@pobox.com>2017-07-10 13:59:05 -0700
commita9e87e3204280dd005bcb7d4bea6f833b27da03d (patch)
treec1077a1a57cda416a2ad999ad80a4e3b8fe65ec5 /read-cache.c
parent76de71b4879003ce2c2a7f9ac22e059183e00e11 (diff)
parent3ee83f48e5cfdfe2e3c783df1f3162e9383732fa (diff)
downloadgit-a9e87e3204280dd005bcb7d4bea6f833b27da03d.tar.gz
Merge branch 'cc/shared-index-permfix' into maint
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 f12da0dbb8..6238df448f 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2428,6 +2428,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) {