diff options
Diffstat (limited to 't/t5701-git-serve.sh')
| -rwxr-xr-x | t/t5701-git-serve.sh | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh index f21e5e9d33..c48830de8f 100755 --- a/t/t5701-git-serve.sh +++ b/t/t5701-git-serve.sh @@ -20,7 +20,6 @@ test_expect_success 'test capability advertisement' ' fetch=shallow wait-for-done server-option object-format=$(test_oid algo) - object-info EOF cat >expect.trailer <<-EOF && 0000 @@ -52,7 +51,7 @@ test_expect_success 'request invalid capability' ' 0000 EOF test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in && - test_i18ngrep "unknown capability" err + test_grep "unknown capability" err ' test_expect_success 'request with no command' ' @@ -62,7 +61,7 @@ test_expect_success 'request with no command' ' 0000 EOF test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in && - test_i18ngrep "no command requested" err + test_grep "no command requested" err ' test_expect_success 'request invalid command' ' @@ -73,7 +72,7 @@ test_expect_success 'request invalid command' ' 0000 EOF test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in && - test_i18ngrep "invalid command" err + test_grep "invalid command" err ' test_expect_success 'request capability as command' ' @@ -115,7 +114,7 @@ test_expect_success 'wrong object-format' ' 0000 EOF test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in && - test_i18ngrep "mismatched object format" err + test_grep "mismatched object format" err ' # Test the basics of ls-refs @@ -323,6 +322,8 @@ test_expect_success 'unexpected lines are not allowed in fetch request' ' # Test the basics of object-info # test_expect_success 'basics of object-info' ' + test_config transfer.advertiseObjectInfo true && + test-tool pkt-line pack >in <<-EOF && command=object-info object-format=$(test_oid algo) @@ -380,4 +381,25 @@ test_expect_success 'basics of bundle-uri: dies if not enabled' ' test_must_be_empty out ' +test_expect_success 'object-info missing from capabilities when disabled' ' + test_config transfer.advertiseObjectInfo false && + + GIT_TEST_SIDEBAND_ALL=0 test-tool serve-v2 \ + --advertise-capabilities >out && + test-tool pkt-line unpack <out >actual && + + ! grep object.info actual +' + +test_expect_success 'object-info commands rejected when disabled' ' + test_config transfer.advertiseObjectInfo false && + + test-tool pkt-line pack >in <<-EOF && + command=object-info + EOF + + test_must_fail test-tool serve-v2 --stateless-rpc <in 2>err && + grep invalid.command err +' + test_done |
