t1400: test that stdin -z update treats empty <newvalue> as zeros

This is the (slightly inconsistent) status quo; make sure it doesn't change by accident. 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 191f241b528c10e242d045bde2cef70fb013a6e5
1 file changed +7
t/t1400-update-ref.sh
+7
@@ -730,6 +730,13 @@ test_expect_success 'stdin -z fails update with bad ref name' '
730 grep "fatal: invalid ref format: ~a" err
731 '
732
733 +test_expect_success 'stdin -z treats empty new value as zeros' '
734 + git update-ref $a $m &&
735 + printf $F "update $a" "" "" >stdin &&
736 + git update-ref -z --stdin <stdin &&
737 + test_must_fail git rev-parse --verify -q $a
738 +'
739 +
740 test_expect_success 'stdin -z fails update with no new value' '
741 printf $F "update $a" >stdin &&
742 test_must_fail git update-ref -z --stdin <stdin 2>err &&