git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] upload-pack: fix error message typo

From
JTJonathan Tan <jonathantanmy@google.com>
Date
May 1, 2018, 22:22 UTC
Message-ID
<15e1fa5e6167932d878aa08e81d541c403935172.1525213052.git.jonathantanmy@google.com>
In-Reply-To
<cover.1525213052.git.jonathantanmy@google.com>
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>
---
 t/t5701-git-serve.sh | 15 +++++++++++++++
 upload-pack.c        |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index 72d7bc562..abbe5b19e 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -173,4 +173,19 @@ test_expect_success 'symrefs parameter' '
 	test_cmp actual expect
 '
 
+test_expect_success 'unexpected lines are not allowed in fetch request' '
+	git init server &&
+
+	# Custom request that tries to filter even though it is not advertised.
+	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 <in >/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 87b4d32a6..c4456bb88 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);
 	}
 }
 
-- 
2.17.0.441.gb46fe60e1d-goog
Previous: Jonathan TanNext: Jonathan Tan
Message 2 of 20 in “Supporting partial clones in protocol v2”
  1. 0/2 Supporting partial clones in protocol v2Jonathan Tan, May 1, 2018
  2. 1/2 upload-pack: fix error message typoJonathan Tan, May 1, 2018
  3. Jonathan TanMay 1, 2018
  4. 2/2 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 1, 2018
  5. Brandon WilliamsMay 1, 2018
  6. 0/3 Supporting partial clones in protocol v2Jonathan Tan, May 2, 2018
  7. 1/3 upload-pack: fix error message typoJonathan Tan, May 2, 2018
  8. Stefan BellerMay 3, 2018
  9. Jonathan TanMay 3, 2018
  10. Junio C HamanoMay 4, 2018
  11. Jonathan TanMay 4, 2018
  12. 2/3 upload-pack: read config when serving protocol v2Jonathan Tan, May 2, 2018
  13. Stefan BellerMay 3, 2018
  14. Jonathan TanMay 3, 2018
  15. 3/3 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 2, 2018
  16. Stefan BellerMay 3, 2018
  17. 0/3 Supporting partial clones in protocol v2Jonathan Tan, May 3, 2018
  18. 1/3 upload-pack: fix error message typoJonathan Tan, May 3, 2018
  19. 2/3 upload-pack: read config when serving protocol v2Jonathan Tan, May 3, 2018
  20. 3/3 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.