Code

Don't allow git-describe failures to go unnoticed in t6120
authorShawn O. Pearce <spearce@spearce.org>
Tue, 4 Mar 2008 01:09:31 +0000 (20:09 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Mar 2008 02:26:23 +0000 (18:26 -0800)
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>
t/t6120-describe.sh

index a7557bdc79623dfc7648097985b8d09aea1801df..ba9ea60d10032df507d84bb8e7faa9acbbd1ef30 100755 (executable)
@@ -15,8 +15,10 @@ test_description='test describe
 check_describe () {
        expect="$1"
        shift
-       R=$(git describe "$@") &&
+       R=$(git describe "$@")
+       S=$?
        test_expect_success "describe $*" '
+       test $S = 0 &&
        case "$R" in
        $expect)        echo happy ;;
        *)      echo "Oops - $R is not $expect";