Don't allow git-describe failures to go unnoticed in t6120
If git-describe fails we never execute the test_expect_success, so we never actually test for failure. This is horribly wrong. We need to always run the test case, but the test case is only supposed to succeed if the prior git-describe returned 0. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Shawn O. Pearce committed
Mar 3, 2008 at 20:09 UTC
be7bae0d4821462c50c5b82633edb372fe971e9e
1 file changed
+3
-1
t/t6120-describe.sh
+3
-1
@@ -15,8 +15,10 @@ test_description='test describe
15
check_describe () {
16
expect="$1"
17
shift
18
- R=$(git describe "$@") &&
18
+ R=$(git describe "$@")
19
+ S=$?
20
test_expect_success "describe $*" '
21
+ test $S = 0 &&
22
case "$R" in
23
$expect) echo happy ;;
24
*) echo "Oops - $R is not $expect";