aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2022-08-19 18:03:53 +0200
committerJunio C Hamano <gitster@pobox.com>2022-08-19 11:13:13 -0700
commit9e4658d5c6917b926a299a55ff8b18ca256e301c (patch)
tree91925633e046dde8b92030d1ddc77f48cf96e5df
parentgit.c: update NO_PARSEOPT markings (diff)
downloadgit-9e4658d5c6917b926a299a55ff8b18ca256e301c.tar.gz
git-9e4658d5c6917b926a299a55ff8b18ca256e301c.zip
t3301-notes.sh: check that default operation mode doesn't take arguments
'git notes' without a subcommand defaults to listing all notes and doesn't accept any arguments. We are about to teach parse-options to handle subcommands, and update 'git notes' to make use of that new feature. So let's add a test to make sure that the upcoming changes don't inadvertenly change the behavior in this corner case. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t3301-notes.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index d742be8840..3288aaec7d 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -505,6 +505,11 @@ test_expect_success 'list notes with "git notes"' '
test_cmp expect actual
'
+test_expect_success '"git notes" without subcommand does not take arguments' '
+ test_expect_code 129 git notes HEAD^^ 2>err &&
+ grep "^error: unknown subcommand" err
+'
+
test_expect_success 'list specific note with "git notes list <object>"' '
git rev-parse refs/notes/commits:$commit_3 >expect &&
git notes list HEAD^^ >actual &&