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>
Michael Haggerty committed
Apr 7, 2014 at 15:48 UTC
ff6ee39525244b7c1bca1953743fdcc14605a031
1 file changed
+7
-1
t/t1400-update-ref.sh
+7
-1
@@ -724,8 +724,14 @@ test_expect_success 'stdin -z fails update with no ref' '
724
grep "fatal: update line missing <ref>" err
725
'
726
727
+test_expect_success 'stdin -z fails update with too few args' '
728
+ printf $F "update $a" "$m" >stdin &&
729
+ test_must_fail git update-ref -z --stdin <stdin 2>err &&
730
+ grep "fatal: update $a missing <oldvalue>" err
731
+'
732
+
733
test_expect_success 'stdin -z fails update with bad ref name' '
728
- printf $F "update ~a" "$m" >stdin &&
734
+ printf $F "update ~a" "$m" "" >stdin &&
735
test_must_fail git update-ref -z --stdin <stdin 2>err &&
736
grep "fatal: invalid ref format: ~a" err
737
'