Doan Tran Cong Danh <congdan...@gmail.com> writes:

> If we accidentally lifted the check inside our code base, the test may
> still failed because the provided parameter is not a valid ref.

Makes sense.  Another option would be to use a valid ref to make
sure there are no other possible reason for the command to fail,
which would make the test robust against us accidentally switching
the order of the check to see if they are refs first and then
complain about too many or too few arguments ;-)  But I think what
we have here is fine as-is (I'll copy-edit the proposed log message
for grammos, though).

Thanks.

>
> Correct it.
>
> Signed-off-by: Doan Tran Cong Danh <congdan...@gmail.com>
> ---
>  t/t3301-notes.sh | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
> index d3fa298c6a..d7767e4438 100755
> --- a/t/t3301-notes.sh
> +++ b/t/t3301-notes.sh
> @@ -1167,8 +1167,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides 
> config' '
>  '
>  
>  test_expect_success 'git notes copy diagnoses too many or too few 
> parameters' '
> -     test_must_fail git notes copy &&
> -     test_must_fail git notes copy one two three
> +     test_must_fail git notes copy 2>error &&
> +     test_i18ngrep "too few parameters" error &&
> +     test_must_fail git notes copy one two three 2>error &&
> +     test_i18ngrep "too many parameters" error
>  '
>  
>  test_expect_success 'git notes get-ref expands refs/heads/master to 
> refs/notes/refs/heads/master' '

Reply via email to