From: Michael Haggerty Date: Mon, 7 Apr 2014 13:48:07 +0000 (+0200) Subject: t1400: test one mistake at a time X-Git-Tag: v2.1.0-rc0~200^2~11 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ff6ee39525244b7c1bca1953743fdcc14605a031?ds=inline;hp=--cc t1400: test one mistake at a time This case wants to test passing a bad refname to the "update" command. But it also passes too few arguments to "update", which muddles the situation: which error should be diagnosed? So split this test into two: * One that passes too few arguments to update * One that passes all three arguments to "update", but with a bad refname. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- ff6ee39525244b7c1bca1953743fdcc14605a031 diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 2d61cceb4c..6b21e459e6 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -724,8 +724,14 @@ test_expect_success 'stdin -z fails update with no ref' ' grep "fatal: update line missing " err ' +test_expect_success 'stdin -z fails update with too few args' ' + printf $F "update $a" "$m" >stdin && + test_must_fail git update-ref -z --stdin err && + grep "fatal: update $a missing " err +' + test_expect_success 'stdin -z fails update with bad ref name' ' - printf $F "update ~a" "$m" >stdin && + printf $F "update ~a" "$m" "" >stdin && test_must_fail git update-ref -z --stdin err && grep "fatal: invalid ref format: ~a" err '