From 9ee6bcd398057cb0cf3c52b9dc93b094d3d37235 Mon Sep 17 00:00:00 2001 From: Tay Ray Chuan Date: Thu, 8 Apr 2010 10:15:16 +0800 Subject: t5541-http-push: add test for URLs with trailing slash Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- t/t5541-http-push.sh | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index 53f54a2789..7873d9429a 100755 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@ -34,8 +34,34 @@ test_expect_success 'setup remote repository' ' mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH" ' -test_expect_success 'clone remote repository' ' +cat >exp <act <"$HTTPD_ROOT_PATH"/access.log && + + # Clear the log, so that it does not affect the "used receive-pack + # service" test which reads the log too. + # + # We do this before the actual comparison to ensure the log is cleared. + echo > "$HTTPD_ROOT_PATH"/access.log && + + test_cmp exp act +' + +test_expect_success 'clone remote repository' ' + rm -rf test_repo_clone && git clone $HTTPD_URL/smart/test_repo.git test_repo_clone ' @@ -68,6 +94,7 @@ test_expect_success 'create and delete remote branch' ' ' cat >exp < Date: Thu, 8 Apr 2010 10:15:18 +0800 Subject: remote-curl: ensure that URLs have a trailing slash Previously, we blindly assumed that URLs passed to the remote-curl helper did not end with a trailing slash. Use the convenience function end_url_with_slash() from http.[ch] to ensure that URLs have a trailing slash on invocation of the remote-curl helper, and use the URL as one with a trailing slash throughout. It is possible for users to pass a URL with a trailing slash to remote-curl, by, say, setting it in remote..url in their git config. The resulting requests have an empty path component (//) and may break implementations of the http git protocol. Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- t/t5541-http-push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index 7873d9429a..f0c50d3d77 100755 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@ -38,7 +38,7 @@ cat >exp <