Re: [PATCH v2 02/27] t1400: Provide more usual input to the command

2014-03-31 Thread Junio C Hamano
Michael Haggerty  writes:

> Subject: Re: [PATCH v2 02/27] t1400: Provide more usual input to the command

This applies to the patches throughout the series, but during the
microproject reviews, Eric pointed out that we seem to start the
summary after area: on the subject with lowercase and omit the full
stop at the end, so I'll try to tweak the subjects while queueing to
read patches in the series.

> 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  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  on the "update" line.

Interesting.  So the test used to expect failure, but we couldn't
tell if that was due to giving a "Please update to this value" which
is malformed, or "I am giving 0{40} as the old value, telling you
that you have to make sure the ref does not exist" which does not
hold because we already have that ref?

That would mean that the test may not have been testing the right
thing.  A good change.

> Signed-off-by: Michael Haggerty 
> ---
>  t/t1400-update-ref.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
> index fa927d2..29391c6 100755
> --- a/t/t1400-update-ref.sh
> +++ b/t/t1400-update-ref.sh
> @@ -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 err &&
>   grep "fatal: Cannot lock the ref '"'"'$c'"'"'" err &&
>   git rev-parse $m >expect &&
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 02/27] t1400: Provide more usual input to the command

2014-03-24 Thread Michael Haggerty
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  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  on the "update" line.

Signed-off-by: Michael Haggerty 
---
 t/t1400-update-ref.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index fa927d2..29391c6 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -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 err &&
grep "fatal: Cannot lock the ref '"'"'$c'"'"'" err &&
git rev-parse $m >expect &&
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html