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

Re: [PATCH] t1512: test ambiguous cat-file --batch and --batch-output

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 23, 2019, 11:11 UTC
Message-ID
<20190123111117.GS840@szeder.dev>
In-Reply-To
<20190118222629.3nvcos24gmi6xe4i@dcvr>
On Fri, Jan 18, 2019 at 10:26:29PM +0000, Eric Wong wrote:
Show 25 quoted lines
> Test the new "ambiguous" result from cat-file --batch and
> --batch-check.  This is in t1512 instead of t1006 since
> we need a repo with ambiguous object_id names.
> 
> Signed-off-by: Eric Wong <e@80x24.org>
> ---
>  t/t1512-rev-parse-disambiguation.sh | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
> index e4d5b56014..b0819630c9 100755
> --- a/t/t1512-rev-parse-disambiguation.sh
> +++ b/t/t1512-rev-parse-disambiguation.sh
> @@ -388,4 +388,14 @@ test_expect_success C_LOCALE_OUTPUT 'ambiguous commits are printed by type first
>  	done
>  '
>  
> +test_expect_success 'cat-file --batch and --batch-check show ambiguous' '
> +	echo "0000 ambiguous" >expect &&
> +	echo 0000 | git cat-file --batch-check >actual 2>err &&
> +	test_cmp expect actual &&
> +	grep hint: err &&
> +	echo 0000 | git cat-file --batch >actual 2>err &&
> +	test_cmp expect actual &&
> +	grep hint: err

The 'git cat-file's error message and hints are translated, so they should be checked by 'test_i18ngrep' instead of plain old grep.

Show 5 quoted lines
> +'
> +
>  test_done
> -- 
> EW
Previous: David TurnerNext: Eric Wong
Message 7 of 8 in “cat-file ambiguity prints "dangling"”
  1. Eric WongJan 18, 2019
  2. David TurnerJan 18, 2019
  3. Eric WongJan 18, 2019
  4. David TurnerJan 18, 2019
  5. t1512: test ambiguous cat-file --batch and --batch-outputEric Wong, Jan 18, 2019
  6. David TurnerJan 18, 2019
  7. SZEDER GáborJan 23, 2019
  8. t1512: test ambiguous cat-file --batch and --batch-outputEric Wong, Jan 30, 2019

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.