t5570: use ls-remote instead of clone for interp tests
We don't actually care about the clone operation here; we just want to know if we were able to actually contact the remote repository. Using ls-remote does that more efficiently, and without us having to worry about managing the tmp.git directory. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jan 24, 2018 at 19:55 UTC
02adf84ab8996cb80d7468f1d3c13be19f929294
1 file changed
+3
-6
t/t5570-git-daemon.sh
+3
-6
@@ -167,23 +167,20 @@ test_expect_success 'access repo via interpolated hostname' '
167
git init --bare "$repo" &&
168
git push "$repo" HEAD &&
169
>"$repo"/git-daemon-export-ok &&
170
- rm -rf tmp.git &&
170
GIT_OVERRIDE_VIRTUAL_HOST=localhost \
172
- git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git &&
173
- rm -rf tmp.git &&
171
+ git ls-remote "$GIT_DAEMON_URL/interp.git" &&
172
GIT_OVERRIDE_VIRTUAL_HOST=LOCALHOST \
175
- git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git
173
+ git ls-remote "$GIT_DAEMON_URL/interp.git"
174
'
175
176
test_expect_success 'hostname cannot break out of directory' '
179
- rm -rf tmp.git &&
177
repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/../escape.git" &&
178
git init --bare "$repo" &&
179
git push "$repo" HEAD &&
180
>"$repo"/git-daemon-export-ok &&
181
test_must_fail \
182
env GIT_OVERRIDE_VIRTUAL_HOST=.. \
186
- git clone --bare "$GIT_DAEMON_URL/escape.git" tmp.git
183
+ git ls-remote "$GIT_DAEMON_URL/escape.git"
184
'
185
186
stop_git_daemon