From: Jonathan Tan Date: Wed, 2 May 2018 00:31:29 +0000 (-0700) Subject: upload-pack: fix error message typo X-Git-Tag: v2.18.0-rc0~16^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7cc6ed2d06d6631726af9c14b5258d723c513327 upload-pack: fix error message typo Fix a typo in an error message. Also, this line was introduced in 3145ea957d2c ("upload-pack: introduce fetch server command", 2018-03-15), which did not contain a test for the case which causes this error to be printed, so introduce a test. Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh index 72d7bc5628..1b4b13cc2b 100755 --- a/t/t5701-git-serve.sh +++ b/t/t5701-git-serve.sh @@ -173,4 +173,18 @@ test_expect_success 'symrefs parameter' ' test_cmp actual expect ' +test_expect_success 'unexpected lines are not allowed in fetch request' ' + git init server && + + test-pkt-line pack >in <<-EOF && + command=fetch + 0001 + this-is-not-a-command + 0000 + EOF + + test_must_fail git -C server serve --stateless-rpc /dev/null 2>err && + grep "unexpected line: .this-is-not-a-command." err +' + test_done diff --git a/upload-pack.c b/upload-pack.c index 87b4d32a6e..c4456bb88a 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -1252,7 +1252,7 @@ static void process_args(struct packet_reader *request, } /* ignore unknown lines maybe? */ - die("unexpect line: '%s'", arg); + die("unexpected line: '%s'", arg); } }