Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-27 20:59:27 +0300
committerJunio C Hamano <gitster@pobox.com>2017-03-27 20:59:27 +0300
commit4e87565d2a3e315b7afc39e9e1fe98c5607a1b11 (patch)
tree6f268f4c98d8c9a06536a5a2fbea5ee9a7df83fc /t
parent4a2b50a1e3667ee40bf08726fb249b634e9df1b6 (diff)
parent511155db51ff9870d2b3fd74c6dfdd558b5fa37b (diff)
Merge branch 'sb/push-options-via-transport'
Recently we started passing the "--push-options" through the external remote helper interface; now the "smart HTTP" remote helper understands what to do with the passed information. * sb/push-options-via-transport: remote-curl: allow push options send-pack: send push options correctly in stateless-rpc case
Diffstat (limited to 't')
-rwxr-xr-xt/t5545-push-options.sh33
1 files changed, 31 insertions, 2 deletions
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 9a57a7d8f2..97065e62b8 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -102,17 +102,46 @@ test_expect_success 'two push options work' '
test_cmp expect upstream/.git/hooks/post-receive.push_options
'
-test_expect_success 'push option denied properly by http remote helper' '\
+test_expect_success 'push option denied properly by http server' '
+ test_when_finished "rm -rf test_http_clone" &&
+ test_when_finished "rm -rf \"$HTTPD_DOCUMENT_ROOT_PATH\"/upstream.git" &&
mk_repo_pair &&
git -C upstream config receive.advertisePushOptions false &&
git -C upstream config http.receivepack true &&
cp -R upstream/.git "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git &&
git clone "$HTTPD_URL"/smart/upstream test_http_clone &&
test_commit -C test_http_clone one &&
- test_must_fail git -C test_http_clone push --push-option=asdf origin master &&
+ test_must_fail git -C test_http_clone push --push-option=asdf origin master 2>actual &&
+ test_i18ngrep "the receiving end does not support push options" actual &&
git -C test_http_clone push origin master
'
+test_expect_success 'push options work properly across http' '
+ test_when_finished "rm -rf test_http_clone" &&
+ test_when_finished "rm -rf \"$HTTPD_DOCUMENT_ROOT_PATH\"/upstream.git" &&
+ mk_repo_pair &&
+ git -C upstream config receive.advertisePushOptions true &&
+ git -C upstream config http.receivepack true &&
+ cp -R upstream/.git "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git &&
+ git clone "$HTTPD_URL"/smart/upstream test_http_clone &&
+
+ test_commit -C test_http_clone one &&
+ git -C test_http_clone push origin master &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
+ git -C test_http_clone rev-parse --verify master >actual &&
+ test_cmp expect actual &&
+
+ test_commit -C test_http_clone two &&
+ git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin master &&
+ printf "asdf\nmore structured text\n" >expect &&
+ test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options &&
+ test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/post-receive.push_options &&
+
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
+ git -C test_http_clone rev-parse --verify master >actual &&
+ test_cmp expect actual
+'
+
stop_httpd
test_done