aboutsummaryrefslogtreecommitdiff
path: root/t/t1502-rev-parse-parseopt.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-10-31 02:35:49 -0500
committerJunio C Hamano <gitster@pobox.com>2010-11-09 15:00:10 -0800
commit2b5ec018458bd32f554d4395231680235104d8d8 (patch)
tree30fa677d2958dfec360615442772bb42944ed789 /t/t1502-rev-parse-parseopt.sh
parentcae3aa79aaa62f414c38a44b3073767b1def3a6b (diff)
downloadgit-2b5ec018458bd32f554d4395231680235104d8d8.tar.gz
git-2b5ec018458bd32f554d4395231680235104d8d8.tar.xz
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>
Diffstat (limited to 't/t1502-rev-parse-parseopt.sh')
-rwxr-xr-xt/t1502-rev-parse-parseopt.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index b3195c470..1efd7f76d 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
'