t5570: test git-daemon's --interpolated-path option

We did not test this at all; let's just give a basic sanity check that we can find a path based on virtual hosting, and that the downcase canonicalization works. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Feb 17, 2015 at 03:40 UTC 5248f2dd4fe763ef9d1267f50481deee36ee57c1
1 file changed +16
t/t5570-git-daemon.sh
+16
@@ -141,5 +141,21 @@ test_expect_success 'push disabled' "test_remote_error 'service not enab
141 test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git "
142 test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git "
143
144 +stop_git_daemon
145 +start_git_daemon --interpolated-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH/%H%D"
146 +
147 +test_expect_success 'access repo via interpolated hostname' '
148 + repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/localhost/interp.git" &&
149 + git init --bare "$repo" &&
150 + git push "$repo" HEAD &&
151 + >"$repo"/git-daemon-export-ok &&
152 + rm -rf tmp.git &&
153 + GIT_OVERRIDE_VIRTUAL_HOST=localhost \
154 + git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git &&
155 + rm -rf tmp.git &&
156 + GIT_OVERRIDE_VIRTUAL_HOST=LOCALHOST \
157 + git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git
158 +'
159 +
160 stop_git_daemon
161 test_done