Re: [PATCH v2 2/2] Mark 'git cat-file' sparse-index compatible
From: Derrick Stolee <hidden>
Date: 2024-09-03 14:17:17
On 8/30/24 5:10 PM, Kevin Lyles via GitGitGadget wrote:
From: Kevin Lyles <redacted>
+test_expect_success 'cat-file -p' ' + init_repos && + echo "new content" >>full-checkout/deep/a && + echo "new content" >>sparse-checkout/deep/a && + echo "new content" >>sparse-index/deep/a && + run_on_all git add deep/a && + + test_all_match git cat-file -p :deep/a && + ensure_not_expanded cat-file -p :deep/a && + test_all_match git cat-file -p :folder1/a && + ensure_expanded cat-file -p :folder1/a'
There's one style issue that I missed in the previous version,
which is that the final single-quote (') should be on a new line
after the last line of the test. like this:
---
test_all_match git cat-file -p :folder1/a &&
ensure_expanded cat-file -p :folder1/a
'
---
+test_expect_success 'cat-file --batch' ' + init_repos && + echo "new content" >>full-checkout/deep/a && + echo "new content" >>sparse-checkout/deep/a && + echo "new content" >>sparse-index/deep/a && + run_on_all git add deep/a && + + echo ":deep/a">in && + test_all_match git cat-file --batch <in && + ensure_not_expanded cat-file --batch <in && + + echo ":folder1/a">in && + test_all_match git cat-file --batch <in && + ensure_expanded cat-file --batch <in && + + cat <<-\EOF >in &&
nit: typically we would write this as "cat >in <<-\EOF &&"
+ :deep/a + :folder1/a + EOF + test_all_match git cat-file --batch <in && + ensure_expanded cat-file --batch <in' +
Pointing out the final single-quote here, too. Thank you for updating the heredocs and other format things that I noticed in the previous version. Also, thanks for splitting the patch into two parts. Thanks for working on this! -Stolee