summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Brandon Williams <bmwill@google.com>2018-04-23 15:46:24 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-04-24 11:24:40 +0900
commit5e3548ef161d4d284e35cf5f5d6a181ba4fe707b (patch)
treea1e5175546417ed701dbe109b683142b95111261 /t
parentls-remote: send server options when using protocol v2 (diff)
downloadtgif-5e3548ef161d4d284e35cf5f5d6a181ba4fe707b.tar.xz
fetch: send server options when using protocol v2
Teach fetch to optionally accept server options by specifying them on the cmdline via '-o' or '--server-option'. These server options are sent to the remote end when performing a fetch communicating using protocol version 2. If communicating using a protocol other than v2 the provided options are ignored and not sent to the remote end. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5702-protocol-v2.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 71ef1aee17..dbfd0691c0 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -217,6 +217,22 @@ test_expect_success 'ref advertisment is filtered during fetch using protocol v2
! grep "refs/tags/three" log
'
+test_expect_success 'server-options are sent when fetching' '
+ test_when_finished "rm -f log" &&
+
+ test_commit -C file_parent four &&
+
+ GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
+ fetch -o hello -o world origin master &&
+
+ git -C file_child log -1 --format=%s origin/master >actual &&
+ git -C file_parent log -1 --format=%s >expect &&
+ test_cmp expect actual &&
+
+ grep "server-option=hello" log &&
+ grep "server-option=world" log
+'
+
# Test protocol v2 with 'http://' transport
#
. "$TEST_DIRECTORY"/lib-httpd.sh