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 <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Oct 31, 2010 at 02:35 UTC
2b5ec018458bd32f554d4395231680235104d8d8
1 file changed
+1
-1
t/t1502-rev-parse-parseopt.sh
+1
-1
@@ -40,7 +40,7 @@ extra1 line above used to cause a segfault but no longer does
40
EOF
41
42
test_expect_success 'test --parseopt help output' '
43
- git rev-parse --parseopt -- -h > output < optionspec
43
+ test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&
44
test_cmp expect output
45
'
46