t5570: use ls-remote instead of clone for interp tests
authorJeff King <peff@peff.net>
Thu, 25 Jan 2018 00:55:05 +0000 (19:55 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Jan 2018 18:44:51 +0000 (10:44 -0800)
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>
t/t5570-git-daemon.sh
index 225a022e8a8fe063bc9cb8b8b282323f95bb18e3..f92ebc5cd587b2e83f45d75907ffcdc8be783a01 100755 (executable)
@@ -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