From 2b5ec018458bd32f554d4395231680235104d8d8 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sun, 31 Oct 2010 02:35:49 -0500 Subject: [PATCH] t1502 (rev-parse --parseopt): test exit code from "-h" 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 Signed-off-by: Junio C Hamano --- t/t1502-rev-parse-parseopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh index b3195c4707..1efd7f76dd 100755 --- a/t/t1502-rev-parse-parseopt.sh +++ b/t/t1502-rev-parse-parseopt.sh @@ -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 '