Skip to content

Commit 9e4658d

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 66fa6e8 commit 9e4658d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

t/t3301-notes.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@ test_expect_success 'list notes with "git notes"' '
505505
test_cmp expect actual
506506
'
507507

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+
508513
test_expect_success 'list specific note with "git notes list <object>"' '
509514
git rev-parse refs/notes/commits:$commit_3 >expect &&
510515
git notes list HEAD^^ >actual &&

0 commit comments

Comments
 (0)