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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed May 1, 2018 at 17:31 UTC 7cc6ed2d06d6631726af9c14b5258d723c513327
2 files changed +15 -1
t/t5701-git-serve.sh
+14
@@ -173,4 +173,18 @@ test_expect_success 'symrefs parameter' '
173 test_cmp actual expect
174 '
175
176 +test_expect_success 'unexpected lines are not allowed in fetch request' '
177 + git init server &&
178 +
179 + test-pkt-line pack >in <<-EOF &&
180 + command=fetch
181 + 0001
182 + this-is-not-a-command
183 + 0000
184 + EOF
185 +
186 + test_must_fail git -C server serve --stateless-rpc <in >/dev/null 2>err &&
187 + grep "unexpected line: .this-is-not-a-command." err
188 +'
189 +
190 test_done
upload-pack.c
+1 -1
@@ -1252,7 +1252,7 @@ static void process_args(struct packet_reader *request,
1252 }
1253
1254 /* ignore unknown lines maybe? */
1255 - die("unexpect line: '%s'", arg);
1255 + die("unexpected line: '%s'", arg);
1256 }
1257 }
1258