diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2014-04-07 15:48:07 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-07 12:09:13 -0700 |
commit | ff6ee39525244b7c1bca1953743fdcc14605a031 (patch) | |
tree | 916bf232fd2319de937b2900587f3a3885df579d /t/t1400-update-ref.sh | |
parent | 1fbd504942b20a541ba4fcbe90d3ea21b03717e4 (diff) | |
download | git-ff6ee39525244b7c1bca1953743fdcc14605a031.tar.gz |
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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1400-update-ref.sh')
-rwxr-xr-x | t/t1400-update-ref.sh | 8 |
1 files changed, 7 insertions, 1 deletions
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 <ref>" 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 <stdin 2>err && + grep "fatal: update $a missing <oldvalue>" 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 <stdin 2>err && grep "fatal: invalid ref format: ~a" err ' |