git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: git@vger.kernel.org
Cc: Jonathan Tan <jonathantanmy@google.com>
Subject: [PATCH 1/2] upload-pack: fix error message typo
Date: Tue,  1 May 2018 15:22:20 -0700	[thread overview]
Message-ID: <15e1fa5e6167932d878aa08e81d541c403935172.1525213052.git.jonathantanmy@google.com> (raw)
In-Reply-To: <cover.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


  reply	other threads:[~2018-05-01 22:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 22:22 [PATCH 0/2] Supporting partial clones in protocol v2 Jonathan Tan
2018-05-01 22:22 ` Jonathan Tan [this message]
2018-05-01 22:25   ` [PATCH 1/2] upload-pack: fix error message typo Jonathan Tan
2018-05-01 22:22 ` [PATCH 2/2] {fetch,upload}-pack: support filter in protocol v2 Jonathan Tan
2018-05-01 22:36   ` Brandon Williams
2018-05-02  0:31 ` [PATCH v2 0/3] Supporting partial clones " Jonathan Tan
2018-05-02  0:31 ` [PATCH v2 1/3] upload-pack: fix error message typo Jonathan Tan
2018-05-03 18:58   ` Stefan Beller
2018-05-03 23:41     ` Jonathan Tan
2018-05-04  2:24       ` Junio C Hamano
2018-05-04 16:10         ` Jonathan Tan
2018-05-02  0:31 ` [PATCH v2 2/3] upload-pack: read config when serving protocol v2 Jonathan Tan
2018-05-03 19:08   ` Stefan Beller
2018-05-03 23:45     ` Jonathan Tan
2018-05-02  0:31 ` [PATCH v2 3/3] {fetch,upload}-pack: support filter in " Jonathan Tan
2018-05-03 20:15   ` Stefan Beller
2018-05-03 23:46 ` [PATCH v3 0/3] Supporting partial clones " Jonathan Tan
2018-05-03 23:46 ` [PATCH v3 1/3] upload-pack: fix error message typo Jonathan Tan
2018-05-03 23:46 ` [PATCH v3 2/3] upload-pack: read config when serving protocol v2 Jonathan Tan
2018-05-03 23:46 ` [PATCH v3 3/3] {fetch,upload}-pack: support filter in " Jonathan Tan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15e1fa5e6167932d878aa08e81d541c403935172.1525213052.git.jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).