Skip to content

Commit

Permalink
Don't allow git-describe failures to go unnoticed in t6120
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Mar 4, 2008
1 parent 3167d72 commit be7bae0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/t6120-describe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit be7bae0

Please sign in to comment.