summaryrefslogtreecommitdiff
path: root/t/t5541-http-push.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-21 18:40:09 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-21 18:40:09 -0700
commitc6c4d616739b531b5689b78fbcb2c89d14e70a4f (patch)
tree22c54caba1de01dd61d47603a35d98a6cc9d02a5 /t/t5541-http-push.sh
parent62ff746bef4db9bf8e6b29a593150e2b4adae039 (diff)
parentb0808819e5806f5ff01ffcc34db2796d180ad0d9 (diff)
downloadgit-c6c4d616739b531b5689b78fbcb2c89d14e70a4f.tar.gz
Merge branch 'jk/doc-http-backend'
Improve documentation to illustrate "push authenticated, fetch anonymous" configuration for smart HTTP servers. * jk/doc-http-backend: doc/http-backend: match query-string in apache half-auth example doc/http-backend: give some lighttpd config examples doc/http-backend: clarify "half-auth" repo configuration
Diffstat (limited to 't/t5541-http-push.sh')
-rwxr-xr-xt/t5541-http-push.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 4086f02bc1..beb00be4b1 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -294,5 +294,35 @@ test_expect_success 'push to auth-only-for-push repo' '
test_cmp expect actual
'
+test_expect_success 'create repo without http.receivepack set' '
+ cd "$ROOT_PATH" &&
+ git init half-auth &&
+ (
+ cd half-auth &&
+ test_commit one
+ ) &&
+ git clone --bare half-auth "$HTTPD_DOCUMENT_ROOT_PATH/half-auth.git"
+'
+
+test_expect_success 'clone via half-auth-complete does not need password' '
+ cd "$ROOT_PATH" &&
+ set_askpass wrong &&
+ git clone "$HTTPD_URL"/half-auth-complete/smart/half-auth.git \
+ half-auth-clone &&
+ expect_askpass none
+'
+
+test_expect_success 'push into half-auth-complete requires password' '
+ cd "$ROOT_PATH/half-auth-clone" &&
+ echo two >expect &&
+ test_commit two &&
+ set_askpass user@host &&
+ git push "$HTTPD_URL/half-auth-complete/smart/half-auth.git" &&
+ git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/half-auth.git" \
+ log -1 --format=%s >actual &&
+ expect_askpass both user@host &&
+ test_cmp expect actual
+'
+
stop_httpd
test_done