@@ -8,6 +8,7 @@ test_description='Test shared repository initialization'
8
8
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9
9
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
10
11
+ TEST_CREATE_REPO_NO_TEMPLATE=1
11
12
. ./test-lib.sh
12
13
13
14
# Remove a default ACL from the test dir if possible.
@@ -25,6 +26,7 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' '
25
26
for u in 002 022
26
27
do
27
28
test_expect_success POSIXPERM " shared=1 does not clear bits preset by umask $u " '
29
+ test_when_finished "rm -rf sub" &&
28
30
mkdir sub && (
29
31
cd sub &&
30
32
umask $u &&
42
44
;;
43
45
esac
44
46
'
45
- rm -rf sub
46
47
done
47
48
48
49
test_expect_success ' shared=all' '
49
- mkdir sub &&
50
- cd sub &&
51
50
git init --template= --shared=all &&
52
51
test 2 = $(git config core.sharedrepository)
53
52
'
@@ -132,6 +131,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
132
131
'
133
132
134
133
test_expect_success POSIXPERM ' forced modes' '
134
+ test_when_finished "rm -rf new" &&
135
135
mkdir -p templates/hooks &&
136
136
echo update-server-info >templates/hooks/post-update &&
137
137
chmod +x templates/hooks/post-update &&
@@ -140,7 +140,8 @@ test_expect_success POSIXPERM 'forced modes' '
140
140
(
141
141
cd new &&
142
142
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 &&
144
145
>frotz &&
145
146
git add frotz &&
146
147
git commit -a -m initial &&
@@ -173,6 +174,7 @@ test_expect_success POSIXPERM 'forced modes' '
173
174
'
174
175
175
176
test_expect_success POSIXPERM ' remote init does not use config from cwd' '
177
+ test_when_finished "rm -rf child.git" &&
176
178
git config core.sharedrepository 0666 &&
177
179
umask 0022 &&
178
180
git init --bare child.git &&
@@ -192,7 +194,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (local)' '
192
194
'
193
195
194
196
test_expect_success POSIXPERM ' re-init respects core.sharedrepository (remote)' '
195
- rm -rf child.git &&
197
+ test_when_finished " rm -rf child.git" &&
196
198
umask 0022 &&
197
199
git init --bare --shared=0666 child.git &&
198
200
test_path_is_missing child.git/foo &&
@@ -203,7 +205,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)'
203
205
'
204
206
205
207
test_expect_success POSIXPERM ' template can set core.sharedrepository' '
206
- rm -rf child.git &&
208
+ test_when_finished " rm -rf child.git" &&
207
209
umask 0022 &&
208
210
git config core.sharedrepository 0666 &&
209
211
cp .git/config templates/config &&
0 commit comments