summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-04-07 15:48:04 +0200
committerJunio C Hamano <gitster@pobox.com>2014-04-07 12:09:13 -0700
commit191f241b528c10e242d045bde2cef70fb013a6e5 (patch)
tree6393237737f92d3078e222e8bf6f00a94a7a52d0
parentac1177553d8c632e93c507f8efc80b80e6c7d3d8 (diff)
downloadgit-191f241b528c10e242d045bde2cef70fb013a6e5.tar.gz
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>
-rwxr-xr-xt/t1400-update-ref.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index a2015d0977..208f56e518 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -730,6 +730,13 @@ test_expect_success 'stdin -z fails update with bad ref name' '
grep "fatal: invalid ref format: ~a" err
'
+test_expect_success 'stdin -z treats empty new value as zeros' '
+ git update-ref $a $m &&
+ printf $F "update $a" "" "" >stdin &&
+ git update-ref -z --stdin <stdin &&
+ test_must_fail git rev-parse --verify -q $a
+'
+
test_expect_success 'stdin -z fails update with no new value' '
printf $F "update $a" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&