Re: [PATCH 13/15] t3030 (merge-recursive): use test_expect_code
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 7, 2011, 21:57 UTC
- Message-ID
- <20111207215741.GD2911@elie.hsd1.il.comcast.net>
- In-Reply-To
- <1323286611-4806-14-git-send-email-artagnon@gmail.com>
Patches 9-12 look good.
Ramkumar Ramachandra wrote:
> Use test_expect_code in preference to repeatedly checking exit codes > by hand.
[...]
Show 17 quoted lines
> +++ b/t/t3030-merge-recursive.sh > @@ -285,17 +285,7 @@ test_expect_success 'merge-recursive simple' ' > rm -fr [abcd] && > git checkout -f "$c2" && > > - git merge-recursive "$c0" -- "$c2" "$c1" > - status=$? > - case "$status" in > - 1) > - : happy > - ;; > - *) > - echo >&2 "why status $status!!!" > - false > - ;; > - esac > + test_expect_code 1 git merge-recursive "$c0" -- "$c2" "$c1"
Yeah, this style is kind of repetitive. Worse, if "git checkout" fails with status 1, it would yield a false success. Thanks for fixing it.