From: jyotishkumar725015@gmail.com Date: Mon, 26 Oct 2026 06:13:10 GMT Subject: [PATCH] t1006: skip %(rest) test for whitespace in object names Message-ID: <20261026061310.62950-1-jyotishkumar725015@gmail.com> In-Reply-To: From: jyotish kumar --- t/t1006-cat-file.sh | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh index 72fc8acc61..47d9434bcc 100755 --- a/t/t1006-cat-file.sh +++ b/t/t1006-cat-file.sh @@ -183,21 +183,18 @@ $content" test_cmp expect actual ' - # FIXME: %(rest) is incompatible with object names that include whitespace, - # e.g. HEAD:path/to/a/file with spaces. Use the resolved OID as input to - # test this instead of the raw object name. - if echo "$object_name" | grep -q " "; then - test_rest=test_expect_failure - else - test_rest=test_expect_success - fi - - $test_rest '--batch-check with %(rest)' ' - echo "$type this is some extra content" >expect && - echo "$object_name this is some extra content" | - git cat-file --batch-check="%(objecttype) %(rest)" >actual && - test_cmp expect actual - ' + case "$object_name" in + *[[:space:]]*) + ;; + *) + test_expect_success '--batch-check with %(rest)' ' + echo "$type this is some extra content" >expect && + echo "$object_name this is some extra content" | + git cat-file --batch-check="%(objecttype) %(rest)" >actual && + test_cmp expect actual + ' + ;; + esac test_expect_success '--batch-check with %(objectmode)' ' echo "$mode $oid" >expect && -- 2.43.0