Skip to content

Commit 5248f2d

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94bc83c commit 5248f2d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t5570-git-daemon.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,21 @@ test_expect_success 'push disabled' "test_remote_error 'service not enab
141141
test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git "
142142
test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git "
143143

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+
144160
stop_git_daemon
145161
test_done

0 commit comments

Comments
 (0)