@@ -32,4 +32,21 @@ test_expect_success 'extra delim packet in v2 fetch args' '
test_i18ngrep "expected flush after fetch arguments" err
'
+test_expect_success 'extra delim packet in v2 object-info args' '
+ # protocol expects 0000 flush after the 0001
+ test-tool pkt-line pack >input <<-EOF &&
+ command=object-info
+ object-format=$(test_oid algo)
+ 0001
+ 0001
+ EOF
+
+ cat >err.expect <<-\EOF &&
+ fatal: object-info: expected flush after arguments
+ EOF
+ test_must_fail env GIT_PROTOCOL=version=2 \
+ git upload-pack . <input 2>err.actual &&
+ test_cmp err.expect err.actual
+'
+
test_done
When the object-info protocol v2 call was added in a2ba162cda2 (object-info: support for retrieving object info, 2021-04-20) we didn't add a corresponding test here. We had tests for ls-refs and fetch already since 4845b772458 (upload-pack: handle unexpected delim packets, 2020-03-27), but the same behavior in object-info (which is clearly copied from the template of "ls-refs") did not have the corresponding tests. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- t/t5704-protocol-violations.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)