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>
SZEDER Gábor committed
Aug 19, 2022 at 18:03 UTC
9e4658d5c6917b926a299a55ff8b18ca256e301c
1 file changed
+5
t/t3301-notes.sh
+5
@@ -505,6 +505,11 @@ test_expect_success 'list notes with "git notes"' '
505
test_cmp expect actual
506
'
507
508
+test_expect_success '"git notes" without subcommand does not take arguments' '
509
+ test_expect_code 129 git notes HEAD^^ 2>err &&
510
+ grep "^error: unknown subcommand" err
511
+'
512
+
513
test_expect_success 'list specific note with "git notes list <object>"' '
514
git rev-parse refs/notes/commits:$commit_3 >expect &&
515
git notes list HEAD^^ >actual &&