Skip to content

Commit

Permalink
t1400: test that stdin -z update treats empty <newvalue> as zeros
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Apr 7, 2014
1 parent ac11775 commit 191f241
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/t1400-update-ref.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 191f241

Please sign in to comment.