Since f6ecc62dbf (write_shared_index(): use tempfile module, 2015-08-10) write_shared_index() has been using mks_tempfile() to create the temporary file that will become the shared index. But even before that, it looks like the functions used to create this file didn't call adjust_shared_perm(), which means that the shared index file has always been created with 600 permissions regardless of the shared permission settings. This means that on repositories created with `git init --shared=all` and using the split index feature one gets an error like: fatal: .git/sharedindex.a52f910b489bc462f187ab572ba0086f7b5157de: index file open failed: Permission denied when another user performs any operation that reads the shared index. Let's fix that by using create_tempfile() instead of mks_tempfile() to create the shared index file. Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx> --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index bc156a133e..eb71e93aa4 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2414,7 +2414,7 @@ static int write_shared_index(struct index_state *istate, struct split_index *si = istate->split_index; int fd, ret; - fd = mks_tempfile(&temporary_sharedindex, git_path("sharedindex_XXXXXX")); + fd = create_tempfile(&temporary_sharedindex, git_path("sharedindex_XXXXXX")); if (fd < 0) { hashclr(si->base_sha1); return do_write_locked_index(istate, lock, flags); -- 2.13.1.516.g05ec6e13aa