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

Re: [PATCH] t9300: use cmp instead of test_cmp to compare binary files

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 12, 2014, 17:58 UTC
Message-ID
<xmqq1trgbu0p.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54132E88.8050803@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
> test_cmp is intended to produce diff output for human consumption. The
> input in one instance in t9300-fast-import.sh are binary files, however.
> Use cmp to compare the files.
Thanks.
Show 24 quoted lines
>
> This was noticed because on Windows we have a special implementation of
> test_cmp in pure bash code (to ignore differences due to intermittent CR
> in actual output), and bash runs into an infinite loop due to the binary
> nature of the input.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  t/t9300-fast-import.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index 99f5161..4b13170 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -2687,7 +2687,7 @@ test_expect_success 'R: verify created pack' '
>  test_expect_success \
>  	'R: verify written objects' \
>  	'git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
> -	 test_cmp expect actual &&
> +	 cmp expect actual &&
>  	 a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
>  	 b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
>  	 test $a = $b'
Previous: Johannes SixtNext: Thomas Braun
Message 2 of 4 in “t9300: use cmp instead of test_cmp to compare binary files”
  1. t9300: use cmp instead of test_cmp to compare binary filesJohannes Sixt, Sep 12, 2014
  2. Junio C HamanoSep 12, 2014
  3. Thomas BraunSep 12, 2014
  4. t9300: use test_cmp_bin instead of test_cmp to compare binary filesJohannes Sixt, Sep 12, 2014

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.