From: Doan Tran Cong Danh <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: Doan Tran Cong Danh <congdanhqx@gmail.com>
Subject: [PATCH 1/2] t3301: test diagnose messages for too few/many paramters
Date: Wed, 16 Oct 2019 12:18:40 +0700 [thread overview]
Message-ID: <20191016051841.19896-1-congdanhqx@gmail.com> (raw)
In-Reply-To: <20191015163631.21808-1-congdanhqx@gmail.com>
From commit bbb1b8a35a, ("notes: check number of parameters to "git
notes copy"", 2010-06-28), we have a test for too many or too few
of parameters provided to `git notes copy'.
However, the test is only ensure the command will fail but it doesn't
really check if it fails because of number of parameters.
If we accidentally lifted the check inside our code base, the test may
still failed because the provided parameter is not a valid ref.
Correct it.
Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
---
t/t3301-notes.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index d3fa298c6a..d7767e4438 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -1167,8 +1167,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' '
'
test_expect_success 'git notes copy diagnoses too many or too few parameters' '
- test_must_fail git notes copy &&
- test_must_fail git notes copy one two three
+ test_must_fail git notes copy 2>error &&
+ test_i18ngrep "too few parameters" error &&
+ test_must_fail git notes copy one two three 2>error &&
+ test_i18ngrep "too many parameters" error
'
test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '
--
2.23.0
next prev parent reply other threads:[~2019-10-16 5:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 16:36 [PATCH 0/1] Allow default value for target of git-notes copy Doan Tran Cong Danh
2019-10-15 16:36 ` [PATCH 1/1] notes: copy notes to HEAD by default Doan Tran Cong Danh
2019-10-16 2:01 ` Junio C Hamano
2019-10-16 5:17 ` Danh Doan
2019-10-16 5:18 ` Doan Tran Cong Danh [this message]
2019-10-16 5:18 ` [PATCH 2/2] notes: fix minimum number of parameters to "copy" subcommand Doan Tran Cong Danh
2019-10-18 0:44 ` Junio C Hamano
2019-10-18 0:38 ` [PATCH 1/2] t3301: test diagnose messages for too few/many paramters Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191016051841.19896-1-congdanhqx@gmail.com \
--to=congdanhqx@gmail.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.
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 NNTP newsgroup(s).