The `git serve` built-in was introduced in ed10cb952d (serve:
introduce git-serve, 2018-03-15) as a backend to serve Git protocol v2,
probably originally intended to be spawned by `git upload-pack`.
However, in the version that the protocol v2 patches made it into core
Git, `git upload-pack` calls the `serve()` function directly instead of
spawning `git serve`; The only reason in life for `git serve` to survive
as a built-in command is to provide a way to test the protocol v2
functionality.
Meaning that it does not even have to be a built-in that is installed
with end-user facing Git installations, but it can be a test helper
instead.
Let's make it so.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Johannes Schindelin6 years agocommitted byJunio C Hamano
@ -24,11 +25,11 @@ test_expect_success 'stateless-rpc flag does not list capabilities' '
@@ -24,11 +25,11 @@ test_expect_success 'stateless-rpc flag does not list capabilities' '
@ -204,7 +205,10 @@ test_expect_success 'unexpected lines are not allowed in fetch request' '
@@ -204,7 +205,10 @@ test_expect_success 'unexpected lines are not allowed in fetch request' '
0000
EOF
test_must_fail git -C server serve --stateless-rpc <in >/dev/null 2>err &&
@ -359,12 +359,13 @@ test_expect_success 'even with handcrafted request, filter does not work if not
@@ -359,12 +359,13 @@ test_expect_success 'even with handcrafted request, filter does not work if not
0000
EOF
test_must_fail git -C server serve --stateless-rpc <in >/dev/null 2>err &&
test_must_fail test-tool -C server serve-v2 --stateless-rpc \
<in >/dev/null 2>err &&
grep "unexpected line: .filter blob:none." err &&
# Exercise to ensure that if advertised, filter works
git -C server config uploadpack.allowfilter 1 &&
git -C server serve --stateless-rpc <in >/dev/null
test-tool -C server serve-v2 --stateless-rpc <in >/dev/null
'
test_expect_success 'default refspec is used to filter ref when fetchcing' '
@ -133,7 +133,7 @@ test_expect_success 'mix want and want-ref' '
@@ -133,7 +133,7 @@ test_expect_success 'mix want and want-ref' '
0000
EOF
git serve --stateless-rpc >out <in &&
test-tool serve-v2 --stateless-rpc >out <in &&
check_output
'
@ -153,7 +153,7 @@ test_expect_success 'want-ref with ref we already have commit for' '
@@ -153,7 +153,7 @@ test_expect_success 'want-ref with ref we already have commit for' '