@@ -93,29 +93,29 @@ test_expect_success "setup for testing promisor remote advertisement" '
9393
9494test_expect_success " clone with promisor.advertise set to 'true'" '
9595 git -C server config promisor.advertise true &&
96+ test_when_finished "rm -rf client" &&
9697
9798 # Clone from server to create a client
9899 GIT_NO_LAZY_FETCH=0 git clone -c remote.lop.promisor=true \
99100 -c remote.lop.fetch="+refs/heads/*:refs/remotes/lop/*" \
100101 -c remote.lop.url="file://$(pwd)/lop" \
101102 -c promisor.acceptfromserver=All \
102103 --no-local --filter="blob:limit=5k" server client &&
103- test_when_finished "rm -rf client" &&
104104
105105 # Check that the largest object is still missing on the server
106106 check_missing_objects server 1 "$oid"
107107'
108108
109109test_expect_success " clone with promisor.advertise set to 'false'" '
110110 git -C server config promisor.advertise false &&
111+ test_when_finished "rm -rf client" &&
111112
112113 # Clone from server to create a client
113114 GIT_NO_LAZY_FETCH=0 git clone -c remote.lop.promisor=true \
114115 -c remote.lop.fetch="+refs/heads/*:refs/remotes/lop/*" \
115116 -c remote.lop.url="file://$(pwd)/lop" \
116117 -c promisor.acceptfromserver=All \
117118 --no-local --filter="blob:limit=5k" server client &&
118- test_when_finished "rm -rf client" &&
119119
120120 # Check that the largest object is not missing on the server
121121 check_missing_objects server 0 "" &&
@@ -126,14 +126,14 @@ test_expect_success "clone with promisor.advertise set to 'false'" '
126126
127127test_expect_success " clone with promisor.acceptfromserver set to 'None'" '
128128 git -C server config promisor.advertise true &&
129+ test_when_finished "rm -rf client" &&
129130
130131 # Clone from server to create a client
131132 GIT_NO_LAZY_FETCH=0 git clone -c remote.lop.promisor=true \
132133 -c remote.lop.fetch="+refs/heads/*:refs/remotes/lop/*" \
133134 -c remote.lop.url="file://$(pwd)/lop" \
134135 -c promisor.acceptfromserver=None \
135136 --no-local --filter="blob:limit=5k" server client &&
136- test_when_finished "rm -rf client" &&
137137
138138 # Check that the largest object is not missing on the server
139139 check_missing_objects server 0 "" &&
@@ -144,8 +144,8 @@ test_expect_success "clone with promisor.acceptfromserver set to 'None'" '
144144
145145test_expect_success " init + fetch with promisor.advertise set to 'true'" '
146146 git -C server config promisor.advertise true &&
147-
148147 test_when_finished "rm -rf client" &&
148+
149149 mkdir client &&
150150 git -C client init &&
151151 git -C client config remote.lop.promisor true &&
@@ -162,29 +162,29 @@ test_expect_success "init + fetch with promisor.advertise set to 'true'" '
162162
163163test_expect_success " clone with promisor.acceptfromserver set to 'KnownName'" '
164164 git -C server config promisor.advertise true &&
165+ test_when_finished "rm -rf client" &&
165166
166167 # Clone from server to create a client
167168 GIT_NO_LAZY_FETCH=0 git clone -c remote.lop.promisor=true \
168169 -c remote.lop.fetch="+refs/heads/*:refs/remotes/lop/*" \
169170 -c remote.lop.url="file://$(pwd)/lop" \
170171 -c promisor.acceptfromserver=KnownName \
171172 --no-local --filter="blob:limit=5k" server client &&
172- test_when_finished "rm -rf client" &&
173173
174174 # Check that the largest object is still missing on the server
175175 check_missing_objects server 1 "$oid"
176176'
177177
178178test_expect_success " clone with 'KnownName' and different remote names" '
179179 git -C server config promisor.advertise true &&
180+ test_when_finished "rm -rf client" &&
180181
181182 # Clone from server to create a client
182183 GIT_NO_LAZY_FETCH=0 git clone -c remote.serverTwo.promisor=true \
183184 -c remote.serverTwo.fetch="+refs/heads/*:refs/remotes/lop/*" \
184185 -c remote.serverTwo.url="file://$(pwd)/lop" \
185186 -c promisor.acceptfromserver=KnownName \
186187 --no-local --filter="blob:limit=5k" server client &&
187- test_when_finished "rm -rf client" &&
188188
189189 # Check that the largest object is not missing on the server
190190 check_missing_objects server 0 "" &&
@@ -195,14 +195,14 @@ test_expect_success "clone with 'KnownName' and different remote names" '
195195
196196test_expect_success " clone with promisor.acceptfromserver set to 'KnownUrl'" '
197197 git -C server config promisor.advertise true &&
198+ test_when_finished "rm -rf client" &&
198199
199200 # Clone from server to create a client
200201 GIT_NO_LAZY_FETCH=0 git clone -c remote.lop.promisor=true \
201202 -c remote.lop.fetch="+refs/heads/*:refs/remotes/lop/*" \
202203 -c remote.lop.url="file://$(pwd)/lop" \
203204 -c promisor.acceptfromserver=KnownUrl \
204205 --no-local --filter="blob:limit=5k" server client &&
205- test_when_finished "rm -rf client" &&
206206
207207 # Check that the largest object is still missing on the server
208208 check_missing_objects server 1 "$oid"
@@ -212,14 +212,14 @@ test_expect_success "clone with 'KnownUrl' and different remote urls" '
212212 ln -s lop serverTwo &&
213213
214214 git -C server config promisor.advertise true &&
215+ test_when_finished "rm -rf client" &&
215216
216217 # Clone from server to create a client
217218 GIT_NO_LAZY_FETCH=0 git clone -c remote.lop.promisor=true \
218219 -c remote.lop.fetch="+refs/heads/*:refs/remotes/lop/*" \
219220 -c remote.lop.url="file://$(pwd)/serverTwo" \
220221 -c promisor.acceptfromserver=KnownUrl \
221222 --no-local --filter="blob:limit=5k" server client &&
222- test_when_finished "rm -rf client" &&
223223
224224 # Check that the largest object is not missing on the server
225225 check_missing_objects server 0 "" &&
0 commit comments