Skip to content

Commit

Permalink
t1502 (rev-parse --parseopt): test exit code from "-h"
Browse files Browse the repository at this point in the history
rev-parse --parseopt exits with code 129 (usage error) when asked
to dump usage with -h on behalf of another command.  Scripts can
take advantage of this to avoid trying to parse usage information
as though it were the regular output from some git command.

Noticed with an &&-chaining tester.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Nov 9, 2010
1 parent cae3aa7 commit 2b5ec01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/t1502-rev-parse-parseopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extra1 line above used to cause a segfault but no longer does
EOF

test_expect_success 'test --parseopt help output' '
git rev-parse --parseopt -- -h > output < optionspec
test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&
test_cmp expect output
'

Expand Down

0 comments on commit 2b5ec01

Please sign in to comment.