From 466ddf90c2f270b973d141f20e912f743743331c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 17 Jan 2009 16:11:51 +0100 Subject: http-push: when making directories, have a trailing slash in the path name The function lock_remote() sends MKCOL requests to make leading directories; However, if it does not put a forward slash '/' at the end of the path, the server sends a 301 redirect. By leaving the '/' in place, we can avoid this additional step. Incidentally, at least one version of Curl (7.16.3) does not resend credentials when it follows a 301 redirect, so this commit also fixes a bug. Original patch by Tay Ray Chuan . Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/lib-httpd/apache.conf | 2 ++ t/t5540-http-push.sh | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 't') diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf index 4717c2d33..fdb19a50f 100644 --- a/t/lib-httpd/apache.conf +++ b/t/lib-httpd/apache.conf @@ -1,6 +1,8 @@ ServerName dummy PidFile httpd.pid DocumentRoot www +LogFormat "%h %l %u %t \"%r\" %>s %b" common +CustomLog access.log common ErrorLog error.log diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh index da9588645..22cfbb6a2 100755 --- a/t/t5540-http-push.sh +++ b/t/t5540-http-push.sh @@ -76,6 +76,12 @@ test_expect_failure 'create and delete remote branch' ' test_must_fail git show-ref --verify refs/remotes/origin/dev ' +test_expect_success 'MKCOL sends directory names with trailing slashes' ' + + ! grep "\"MKCOL.*[^/] HTTP/[^ ]*\"" < "$HTTPD_ROOT_PATH"/access.log + +' + stop_httpd test_done -- cgit v1.2.1