Skip to content

Commit

Permalink
t1400: test one mistake at a time
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Apr 7, 2014
1 parent 1fbd504 commit ff6ee39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t/t1400-update-ref.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down

0 comments on commit ff6ee39

Please sign in to comment.