git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] t0020-crlf: check the right file

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2018, 16:11 UTC
Message-ID
<xmqqo9du5qlf.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180822124437.11242-1-szeder.dev@gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 9 quoted lines
> In the test 'checkout with autocrlf=input' in 't0020-crlf.sh', one of
> the 'has_cr' checks looks at the non-existing file 'two' instead of
> 'dir/two'.  The test still succeeds, without actually checking what it
> was supposed to, because this check is expected to fail anyway.
>
> As a minimal fix, fix the name of the file to be checked.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
> ---

This originates from fd777141 ("t0020: fix ignored exit code inside loops", 2015-03-25) where a loop

    for f in one dir/two
    do
            do things on "$f" || break
    done

was unrolled to correctly break out of the &&-chain. The filenames on the update-index line correctly copied one and dir/two, but the has_cr line somehow lost dir/ prefix.

Thanks.  Will queue.
Show 16 quoted lines
>  t/t0020-crlf.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
> index 5f056982a5..854da0ae16 100755
> --- a/t/t0020-crlf.sh
> +++ b/t/t0020-crlf.sh
> @@ -160,7 +160,7 @@ test_expect_success 'checkout with autocrlf=input' '
>  	git config core.autocrlf input &&
>  	git read-tree --reset -u HEAD &&
>  	test_must_fail has_cr one &&
> -	test_must_fail has_cr two &&
> +	test_must_fail has_cr dir/two &&
>  	git update-index -- one dir/two &&
>  	test "$one" = $(git hash-object --stdin <one) &&
>  	test "$two" = $(git hash-object --stdin <dir/two) &&
Previous: SZEDER GáborNext: Jeff King
Message 3 of 4 in “t0020-crlf: check the right file”
  1. 1/2 t0020-crlf: check the right fileSZEDER Gábor, Aug 22, 2018
  2. 2/2 t4051-diff-function-context: read the right fileSZEDER Gábor, Aug 22, 2018
  3. Junio C HamanoAug 22, 2018
  4. Jeff KingAug 22, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.