git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 1/3] t5541-http-push: add test for URLs with trailing slash

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Apr 8, 2010, 02:15 UTC
Message-ID
<1270692918-4300-1-git-send-email-rctay89@gmail.com>
In-Reply-To
<1270656067-688-2-git-send-email-rctay89@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 t/t5541-http-push.sh |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 795dc2b..e94ac78 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
-- 
1.6.6.1368.g82eeb
Previous: Junio C HamanoNext: Tay Ray Chuan
Message 8 of 10 in “remote-curl: ensure that URLs do not have a trailing slash”
  1. remote-curl: ensure that URLs do not have a trailing slashTay Ray Chuan, Apr 7, 2010
  2. Junio C HamanoApr 7, 2010
  3. Tay Ray ChuanApr 7, 2010
  4. 1/2 http: make end_url_with_slash() publicTay Ray Chuan, Apr 7, 2010
  5. 1/2 http: make end_url_with_slash() publicTay Ray Chuan, Apr 7, 2010
  6. 2/2 remote-curl: ensure that URLs have a trailing slashTay Ray Chuan, Apr 7, 2010
  7. Junio C HamanoApr 7, 2010
  8. 1/3 t5541-http-push: add test for URLs with trailing slashTay Ray Chuan, Apr 8, 2010
  9. 2/3 http: make end_url_with_slash() publicTay Ray Chuan, Apr 8, 2010
  10. 3/3 remote-curl: ensure that URLs have a trailing slashTay Ray Chuan, Apr 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.