summaryrefslogtreecommitdiff
path: root/t/t5541-http-push.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-08-27 13:25:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-08-27 17:49:09 (GMT)
commit6ac2b3aeb9900a8fb0cd3fd9be0bff00eb3a4b5b (patch)
treed323ca6e87591eefee98af8ab0abb3accb2f8849 /t/t5541-http-push.sh
parent666aae9aed5a29019d2cd696d4258750c0dc96c7 (diff)
downloadgit-6ac2b3aeb9900a8fb0cd3fd9be0bff00eb3a4b5b.zip
git-6ac2b3aeb9900a8fb0cd3fd9be0bff00eb3a4b5b.tar.gz
git-6ac2b3aeb9900a8fb0cd3fd9be0bff00eb3a4b5b.tar.bz2
t: test basic smart-http authentication
We do not currently test authentication over smart-http at all. In theory, it should work exactly as it does for dumb http (which we do test). It does indeed work for these simple tests, but this patch lays the groundwork for more complex tests in future patches. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5541-http-push.sh')
-rwxr-xr-xt/t5541-http-push.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 312e484..eeb9932 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -36,6 +36,8 @@ test_expect_success 'setup remote repository' '
mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
'
+setup_askpass_helper
+
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
@@ -266,5 +268,17 @@ test_expect_success 'http push respects GIT_COMMITTER_* in reflog' '
test_cmp expect actual
'
+test_expect_success 'push over smart http with auth' '
+ cd "$ROOT_PATH/test_repo_clone" &&
+ echo push-auth-test >expect &&
+ test_commit push-auth-test &&
+ set_askpass user@host &&
+ git push "$HTTPD_URL"/auth/smart/test_repo.git &&
+ git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git" \
+ log -1 --format=%s >actual &&
+ expect_askpass both user@host &&
+ test_cmp expect actual
+'
+
stop_httpd
test_done