Thread (16 messages) flat view 16 messages, 3 authors, 2016-06-15
STALE3733d

[PATCH 04/10] t1502 (rev-parse --parseopt): test exit code from "-h"

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:57
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 t/t1502-rev-parse-parseopt.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index b3195c4..1efd7f7 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
 '
 
-- 
1.7.2.3.557.gab647.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help