summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 7b1354d..2fc2acb 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2774,7 +2774,8 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
struct tempfile *temp;
int saved_errno;
- temp = mks_tempfile(git_path("sharedindex_XXXXXX"));
+ /* Same initial permissions as the main .git/index file */
+ temp = mks_tempfile_sm(git_path("sharedindex_XXXXXX"), 0, 0666);
if (!temp) {
oidclr(&si->base_oid);
ret = do_write_locked_index(istate, lock, flags);