@matheusbsbs / matheus-bagliano / commits / 9ee6bcd398
Fork 0

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>

Tay Ray Chuan committed Apr 8, 2010 at 10:15 UTC 9ee6bcd398057cb0cf3c52b9dc93b094d3d37235
1 file changed +28 -1
t/t5541-http-push.sh
+28 -1
@@ -34,8 +34,34 @@ test_expect_success 'setup remote repository' '
34 mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
35 '
36
37 -test_expect_success 'clone remote repository' '
37 +cat >exp <<EOF
38 +GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
39 +POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
40 +EOF
41 +test_expect_failure 'no empty path components' '
42 + # In the URL, add a trailing slash, and see if git appends yet another
43 + # slash.
44 cd "$ROOT_PATH" &&
45 + git clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone &&
46 +
47 + sed -e "
48 + s/^.* \"//
49 + s/\"//
50 + s/ [1-9][0-9]*\$//
51 + s/^GET /GET /
52 + " >act <"$HTTPD_ROOT_PATH"/access.log &&
53 +
54 + # Clear the log, so that it does not affect the "used receive-pack
55 + # service" test which reads the log too.
56 + #
57 + # We do this before the actual comparison to ensure the log is cleared.
58 + echo > "$HTTPD_ROOT_PATH"/access.log &&
59 +
60 + test_cmp exp act
61 +'
62 +
63 +test_expect_success 'clone remote repository' '
64 + rm -rf test_repo_clone &&
65 git clone $HTTPD_URL/smart/test_repo.git test_repo_clone
66 '
67
@@ -68,6 +94,7 @@ test_expect_success 'create and delete remote branch' '
94 '
95
96 cat >exp <<EOF
97 +
98 GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
99 POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
100 GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200