aboutsummaryrefslogtreecommitdiff
path: root/t/t5541-http-push.sh
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-04-08 10:15:16 +0800
committerJunio C Hamano <gitster@pobox.com>2010-04-09 21:11:03 -0700
commit9ee6bcd398057cb0cf3c52b9dc93b094d3d37235 (patch)
tree0c916d8cd0948cf04e9f8eda50dcb611a1747a7a /t/t5541-http-push.sh
parente923eaeb901ff056421b9007adcbbce271caa7b6 (diff)
downloadgit-9ee6bcd398057cb0cf3c52b9dc93b094d3d37235.tar.gz
git-9ee6bcd398057cb0cf3c52b9dc93b094d3d37235.tar.xz
t5541-http-push: add test for URLs with trailing slash
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5541-http-push.sh')
-rwxr-xr-xt/t5541-http-push.sh29
1 files changed, 28 insertions, 1 deletions
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 53f54a278..7873d9429 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 <<EOF
+GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
+POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
+EOF
+test_expect_failure 'no empty path components' '
+ # In the URL, add a trailing slash, and see if git appends yet another
+ # slash.
cd "$ROOT_PATH" &&
+ git clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone &&
+
+ sed -e "
+ s/^.* \"//
+ s/\"//
+ s/ [1-9][0-9]*\$//
+ s/^GET /GET /
+ " >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 <<EOF
+
GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200