summaryrefslogtreecommitdiff
path: root/t/t5570-git-daemon.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-01-25 00:55:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-25 18:44:51 (GMT)
commit02adf84ab8996cb80d7468f1d3c13be19f929294 (patch)
tree0d4ca03406dae63240d4da34a833e265c60cf0df /t/t5570-git-daemon.sh
parent8279ed033f703d4115bee620dccd32a9ec94d9aa (diff)
downloadgit-02adf84ab8996cb80d7468f1d3c13be19f929294.zip
git-02adf84ab8996cb80d7468f1d3c13be19f929294.tar.gz
git-02adf84ab8996cb80d7468f1d3c13be19f929294.tar.bz2
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>
Diffstat (limited to 't/t5570-git-daemon.sh')
-rwxr-xr-xt/t5570-git-daemon.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 225a022..f92ebc5 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -167,23 +167,20 @@ test_expect_success 'access repo via interpolated hostname' '
git init --bare "$repo" &&
git push "$repo" HEAD &&
>"$repo"/git-daemon-export-ok &&
- rm -rf tmp.git &&
GIT_OVERRIDE_VIRTUAL_HOST=localhost \
- git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git &&
- rm -rf tmp.git &&
+ git ls-remote "$GIT_DAEMON_URL/interp.git" &&
GIT_OVERRIDE_VIRTUAL_HOST=LOCALHOST \
- git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git
+ git ls-remote "$GIT_DAEMON_URL/interp.git"
'
test_expect_success 'hostname cannot break out of directory' '
- rm -rf tmp.git &&
repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/../escape.git" &&
git init --bare "$repo" &&
git push "$repo" HEAD &&
>"$repo"/git-daemon-export-ok &&
test_must_fail \
env GIT_OVERRIDE_VIRTUAL_HOST=.. \
- git clone --bare "$GIT_DAEMON_URL/escape.git" tmp.git
+ git ls-remote "$GIT_DAEMON_URL/escape.git"
'
stop_git_daemon