Skip to content

Commit 90c47b3

Browse files
committed
Merge branch 'jx/t1301-updates'
Test updates. * jx/t1301-updates: t1301: do not change $CWD in "shared=all" test case t1301: use test_when_finished for cleanup t1301: fix wrong template dir for git-init
2 parents 904d404 + bcb71d4 commit 90c47b3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

t/t1301-shared-repo.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ test_description='Test shared repository initialization'
88
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
99
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010

11+
TEST_CREATE_REPO_NO_TEMPLATE=1
1112
. ./test-lib.sh
1213

1314
# Remove a default ACL from the test dir if possible.
@@ -25,6 +26,7 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' '
2526
for u in 002 022
2627
do
2728
test_expect_success POSIXPERM "shared=1 does not clear bits preset by umask $u" '
29+
test_when_finished "rm -rf sub" &&
2830
mkdir sub && (
2931
cd sub &&
3032
umask $u &&
@@ -42,12 +44,9 @@ do
4244
;;
4345
esac
4446
'
45-
rm -rf sub
4647
done
4748

4849
test_expect_success 'shared=all' '
49-
mkdir sub &&
50-
cd sub &&
5150
git init --template= --shared=all &&
5251
test 2 = $(git config core.sharedrepository)
5352
'
@@ -132,6 +131,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
132131
'
133132

134133
test_expect_success POSIXPERM 'forced modes' '
134+
test_when_finished "rm -rf new" &&
135135
mkdir -p templates/hooks &&
136136
echo update-server-info >templates/hooks/post-update &&
137137
chmod +x templates/hooks/post-update &&
@@ -140,7 +140,8 @@ test_expect_success POSIXPERM 'forced modes' '
140140
(
141141
cd new &&
142142
umask 002 &&
143-
git init --shared=0660 --template=templates &&
143+
git init --shared=0660 --template=../templates &&
144+
test_path_is_file .git/hooks/post-update &&
144145
>frotz &&
145146
git add frotz &&
146147
git commit -a -m initial &&
@@ -173,6 +174,7 @@ test_expect_success POSIXPERM 'forced modes' '
173174
'
174175

175176
test_expect_success POSIXPERM 'remote init does not use config from cwd' '
177+
test_when_finished "rm -rf child.git" &&
176178
git config core.sharedrepository 0666 &&
177179
umask 0022 &&
178180
git init --bare child.git &&
@@ -192,7 +194,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (local)' '
192194
'
193195

194196
test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)' '
195-
rm -rf child.git &&
197+
test_when_finished "rm -rf child.git" &&
196198
umask 0022 &&
197199
git init --bare --shared=0666 child.git &&
198200
test_path_is_missing child.git/foo &&
@@ -203,7 +205,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)'
203205
'
204206

205207
test_expect_success POSIXPERM 'template can set core.sharedrepository' '
206-
rm -rf child.git &&
208+
test_when_finished "rm -rf child.git" &&
207209
umask 0022 &&
208210
git config core.sharedrepository 0666 &&
209211
cp .git/config templates/config &&

0 commit comments

Comments
 (0)