Re: [PATCH v2 2/2] Mark 'git cat-file' sparse-index compatible
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Sep 3, 2024, 14:17 UTC
- Message-ID
- <83ec9352-d274-4d05-a6b8-d33924f46205@gmail.com>
- In-Reply-To
- <a92825e502f1795910b869165779279b89212939.1725052243.git.gitgitgadget@gmail.com>
On 8/30/24 5:10 PM, Kevin Lyles via GitGitGadget wrote:
> From: Kevin Lyles <klyles+github@epic.com>
Show 11 quoted lines
> +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 '
---
Show 16 quoted lines
> +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 &&"
Show 6 quoted lines
> + :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