summaryrefslogtreecommitdiff
path: root/t/t5551-http-fetch.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-08-27 09:25:53 -0400
committerJunio C Hamano <gitster@pobox.com>2012-08-27 10:49:09 -0700
commit4c71009da60baee436358e84ff1057cd1c80e776 (patch)
treed311a3b85502a817f37a17964838b826b21daecd /t/t5551-http-fetch.sh
parent6ac2b3aeb9900a8fb0cd3fd9be0bff00eb3a4b5b (diff)
downloadgit-4c71009da60baee436358e84ff1057cd1c80e776.tar.gz
t: test http access to "half-auth" repositories
Some sites set up http access to repositories such that fetching is anonymous and unauthenticated, but pushing is authenticated. While there are multiple ways to do this, the technique advertised in the git-http-backend manpage is to block access to locations matching "/git-receive-pack$". Let's emulate that advice in our test setup, which makes it clear that this advice does not actually work. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5551-http-fetch.sh')
-rwxr-xr-xt/t5551-http-fetch.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index 342d6af861..7380f2a2dd 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -120,6 +120,15 @@ test_expect_success 'clone from password-protected repository' '
test_cmp expect actual
'
+test_expect_success 'clone from auth-only-for-push repository' '
+ echo two >expect &&
+ set_askpass wrong &&
+ git clone --bare "$HTTPD_URL/auth-push/smart/repo.git" smart-noauth &&
+ expect_askpass none &&
+ git --git-dir=smart-noauth log -1 --format=%s >actual &&
+ test_cmp expect actual
+'
+
test -n "$GIT_TEST_LONG" && test_set_prereq EXPENSIVE
test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '