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

[Discussion] t1006: testing %(rest) with object names containing whitespace

From
JKjyotish kumar <jyotishkumar725015@gmail.com>
Date
Oct 24, 2026, 06:47 UTC
Message-ID
<CAGjZMyRqv5RsLF4Vo439zy4urfr+R=CTwuDzmYjiemauuZan0Q@mail.gmail.com>
Hi,

While exploring t/t1006-cat-file.sh, I came across the test for the %(rest) format atom in git cat-file --batch-check.

The test currently contains a FIXME explaining that %(rest) is incompatible with object names containing whitespace, such as HEAD:path/to/a/file with spaces. It uses test_expect_failure for that case and mentions using the resolved object ID as input instead of the original object name.

I investigated this test and noticed that the run_tests() helper already has access to the resolved object ID through $oid. I tried using $oid as the input to the %(rest) test rather than $object_name.

With this change, the focused t1006-cat-file.sh test passed all 423 tests locally.

Before preparing a patch, I wanted to ask whether this is the intended approach for testing %(rest) here, and whether removing the conditional expected-failure logic and using the resolved object ID would be a worthwhile improvement.

I would appreciate your guidance on whether this is worth pursuing or if there is a reason to retain the current test behavior.

Thanks,
Next: Jeff King
Message 1 of 5 in “[Discussion] t1006: testing %(rest) with object names containing whitespace”
  1. jyotish kumarOct 24, 2026
  2. Jeff KingOct 26, 2026
  3. Junio C HamanoOct 26, 2026
  4. jyotish kumarOct 26, 2026
  5. t1006: skip %(rest) test for whitespace in object namesjyotishkumar725015@gmail.com, Oct 26, 2026

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.