Subject: Re: [PATCH] t: use LF variable defined in the test harness

From: Taylor Blau <[email-masked]>
Date: Thu, 5 Sep 2019 14:52:43 -0400

On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:
> Taylor Blau <[email-masked]> writes:
>
> >   - t/t3005: this script calls the variable '$new_line', but could be
> >     renamed to LF and then removed in a second patch
>
> It is worse than that, isn't it?
>
> If it used $new_line, then it would probably have been a good idea
> to somehow make a separate patch related to this one and make a
> series about "use $LF from test-lib", but ever since its beginning
> at 0f64bfa9 ("ls-files: fix pathspec display on error", 2011-08-01),
> $new_line is assigned once but never used in the script.

Ah, thanks for catching it ;-). I think the patch below the scissors is
totally right; there's obviously no need for a preparatory patch here
other than the one you provided.

> Somebody may want to go clean-up the use of various $sq and $SQ
> locally defined by giving a unified $SQ in test-lib.sh, by the way.
>
> -- >8 --
> Subject: t3005: remove unused variable
>
> Since the beginning of the script, $new_line variable was never used.
> Remove it.
>
> Signed-off-by: Junio C Hamano <[email-masked]>
> ---
>  t/t3005-ls-files-relative.sh | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
> index 209b4c7cd8..583e467683 100755
> --- a/t/t3005-ls-files-relative.sh
> +++ b/t/t3005-ls-files-relative.sh
> @@ -7,8 +7,6 @@ This test runs git ls-files with various relative path arguments.
>
>  . ./test-lib.sh
>
> -new_line='
> -'
>  sq=\'
>
>  test_expect_success 'prepare' '

Thanks,
Taylor