t1400: provide more usual input to the command
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 7 Apr 2014 13:47:53 +0000 (15:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2014 19:09:10 +0000 (12:09 -0700)
The old version was passing (among other things)

update SP refs/heads/c NUL NUL 0{40} NUL

to "git update-ref -z --stdin" to test whether the old-value check for
c is working. But the <newvalue> is empty, which is a bit off the
beaten track.

So, to be sure that we are testing what we want to test, provide an
actual <newvalue> on the "update" line.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1400-update-ref.sh
index fa927d21846d64872e6a9d6d4c8acfb822b35957..29391c67fc9aaccba9ce9af5327acfcbba5f3bf0 100755 (executable)
@@ -912,7 +912,7 @@ test_expect_success 'stdin -z update refs works with identity updates' '
 
 test_expect_success 'stdin -z update refs fails with wrong old value' '
        git update-ref $c $m &&
-       printf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "" "$Z" >stdin &&
+       printf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "$m" "$Z" >stdin &&
        test_must_fail git update-ref -z --stdin <stdin 2>err &&
        grep "fatal: Cannot lock the ref '"'"'$c'"'"'" err &&
        git rev-parse $m >expect &&