Subject: [PATCH v5 0/1] cat-file: quote-format name in error when using -z

From: Toon Claes <[email-masked]>
Date: Wed, 10 May 2023 21:01:15 +0200

This is the fifth revision of this patch. The code changes are identical to v3,
but there was one comment[1] about adding test coverage for
batch_object_write(). In v4 I tried another approach, but that didn't work well.
So for this version I'm just adding the test to version 3 as requested. See
below the range-diff against v3, ignoring v4 ever happened.

Kind regards,
Toon

[1]: https://public-inbox.org/git/[email-masked]/

Toon Claes (1):
  cat-file: quote-format name in error when using -z

 builtin/cat-file.c  | 19 +++++++++++++++++++
 t/t1006-cat-file.sh | 27 +++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

Range-diff against v3:
1:  16f7a123d8 ! 1:  14bccfa9fd cat-file: quote-format name in error when using -z
    @@ t/t1006-cat-file.sh: test_expect_success FUNNYNAMES '--batch-check, -z with newl
     +	printf "\"HEAD:newline\\\\nmissing\" missing\n" >expect &&
     +	test_cmp expect actual
     +'
    ++
    ++test_expect_success FUNNYNAMES '--batch-check, -z with missing object having newline in name' '
    ++	git init missing-object-newline &&
    ++	(
    ++		cd missing-object-newline &&
    ++		file="newline${LF}embedded" &&
    ++		echo_without_newline "hello" > $file &&
    ++		git add "$file" &&
    ++		git commit -m "file with newline embedded" &&
    ++		test_tick &&
    ++
    ++		sha1=$(git rev-parse HEAD:"$file") &&
    ++		rm .git/objects/$(test_oid_to_path $sha1) &&
    ++		printf "HEAD:$file" >in &&
    ++		git cat-file --batch-check -z <in >actual &&
    ++		printf "\"HEAD:newline\\\\nembedded\" missing\n" >expect &&
    ++		test_cmp expect actual
    ++	)
    ++'
     +
      batch_command_multiple_info="info $hello_sha1
      info $tree_sha1
--
2.40.1