diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-07-05 13:32:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-05 13:32:57 -0700 |
commit | 8e90578ffbce029a09c2a56e95ba3009f27e4937 (patch) | |
tree | 73b227154ea7014f0d93fecc0e31e70102d75f2b /read-cache.c | |
parent | Merge branch 'rs/sha1-name-readdir-optim' (diff) | |
parent | t1700: make sure split-index respects core.sharedrepository (diff) | |
download | tgif-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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c index 3c4354ee21..2121b6e7bb 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) { |