Skip to content

Commit 6d9f0c7

Browse files
committed
Merge branch 'jk/prune-packed-server-info'
Fix recent breakage in Git 2.2 that started creating info/refs and objects/info/packs files with permission bits tighter than user's umask. * jk/prune-packed-server-info: update-server-info: create info/* with mode 0666 t1301: set umask in reflog sharedrepository=group test
2 parents 7fd92d9 + d91175b commit 6d9f0c7

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

server-info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static int update_info_file(char *path, int (*generate)(FILE *))
1717
FILE *fp = NULL;
1818

1919
safe_create_leading_directories(path);
20-
fd = mkstemp(tmp);
20+
fd = git_mkstemp_mode(tmp, 0666);
2121
if (fd < 0)
2222
goto out;
2323
fp = fdopen(fd, "w");

t/t1301-shared-repo.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,18 @@ do
111111

112112
done
113113

114+
test_expect_success POSIXPERM 'info/refs respects umask in unshared repo' '
115+
rm -f .git/info/refs &&
116+
test_unconfig core.sharedrepository &&
117+
umask 002 &&
118+
git update-server-info &&
119+
echo "-rw-rw-r--" >expect &&
120+
modebits .git/info/refs >actual &&
121+
test_cmp expect actual
122+
'
123+
114124
test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
125+
umask 077 &&
115126
git config core.sharedRepository group &&
116127
git reflog expire --all &&
117128
actual="$(ls -l .git/logs/refs/heads/master)" &&

0 commit comments

Comments
 (0)