remote-curl: implement stateless-connect command
Teach remote-curl the 'stateless-connect' command which is used to establish a stateless connection with servers which support protocol version 2. This allows remote-curl to act as a proxy, allowing the git client to communicate natively with a remote end, simply using remote-curl as a pass through to convert requests to http. 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
237ffedd46
commit
0f1dc53f45
@ -201,4 +201,49 @@ test_expect_success 'ref advertisment is filtered during fetch using protocol v2
|
||||
! grep "refs/tags/three" log
|
||||
'
|
||||
|
||||
# Test protocol v2 with 'http://' transport
|
||||
#
|
||||
. "$TEST_DIRECTORY"/lib-httpd.sh
|
||||
start_httpd
|
||||
|
||||
test_expect_success 'create repo to be served by http:// transport' '
|
||||
git init "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" &&
|
||||
git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" config http.receivepack true &&
|
||||
test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" one
|
||||
'
|
||||
|
||||
test_expect_success 'clone with http:// using protocol v2' '
|
||||
test_when_finished "rm -f log" &&
|
||||
|
||||
GIT_TRACE_PACKET="$(pwd)/log" GIT_TRACE_CURL="$(pwd)/log" git -c protocol.version=2 \
|
||||
clone "$HTTPD_URL/smart/http_parent" http_child &&
|
||||
|
||||
git -C http_child log -1 --format=%s >actual &&
|
||||
git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
|
||||
test_cmp expect actual &&
|
||||
|
||||
# Client requested to use protocol v2
|
||||
grep "Git-Protocol: version=2" log &&
|
||||
# Server responded using protocol v2
|
||||
grep "git< version 2" log
|
||||
'
|
||||
|
||||
test_expect_success 'fetch with http:// using protocol v2' '
|
||||
test_when_finished "rm -f log" &&
|
||||
|
||||
test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" two &&
|
||||
|
||||
GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
|
||||
fetch &&
|
||||
|
||||
git -C http_child log -1 --format=%s origin/master >actual &&
|
||||
git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
|
||||
test_cmp expect actual &&
|
||||
|
||||
# Server responded using protocol v2
|
||||
grep "git< version 2" log
|
||||
'
|
||||
|
||||
stop_httpd
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user