serve: introduce the server-option capability
Introduce the "server-option" capability to protocol version 2. This enables future clients the ability to send server specific options in command requests when using protocol version 2. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
bbc39d4020
commit
ecc3e5342d
@ -10,6 +10,7 @@ test_expect_success 'test capability advertisement' '
|
||||
agent=git/$(git version | cut -d" " -f3)
|
||||
ls-refs
|
||||
fetch=shallow
|
||||
server-option
|
||||
0000
|
||||
EOF
|
||||
|
||||
@ -173,4 +174,24 @@ test_expect_success 'symrefs parameter' '
|
||||
test_cmp actual expect
|
||||
'
|
||||
|
||||
test_expect_success 'sending server-options' '
|
||||
test-pkt-line pack >in <<-EOF &&
|
||||
command=ls-refs
|
||||
server-option=hello
|
||||
server-option=world
|
||||
0001
|
||||
ref-prefix HEAD
|
||||
0000
|
||||
EOF
|
||||
|
||||
cat >expect <<-EOF &&
|
||||
$(git rev-parse HEAD) HEAD
|
||||
0000
|
||||
EOF
|
||||
|
||||
git serve --stateless-rpc <in >out &&
|
||||
test-pkt-line unpack <out >actual &&
|
||||
test_cmp actual expect
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user