Re: [PATCH v2] t7450: inspect the correct path a broken code would write to
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Aug 1, 2025, 16:48 UTC
- Message-ID
- <5hdj64ha2b5ewydtrra2rbzofgzaqnu2rt5enlarqs6u4grjsg@pkdsa6plxsuw>
- In-Reply-To
- <pull.2022.v2.git.git.1753933780883.gitgitgadget@gmail.com>
On 25/07/31 03:49AM, chenjianhu via GitGitGadget wrote:
Show 7 quoted lines
> From: chenjianhu <chenjianh@kylinos.cn> > > Prior to 05e9cd64 (config: quote values containing CR character, > 2025-05-19), a repository can trick "clone --recurse-submodules" > into running a post-checkout hook shipped with the project. The > test was written to make sure the trick would no longer run the > hook with the fix in the commit.
Yep the first assertion in the test exists to ensure that the post-checkout hook in the submodule is not executed. The test also validates via its second assertion that the sumodule cannot be tricked into being checked-out into a symlinked directory.
Show 6 quoted lines
> However, the test did not check for the path the hook would > create; correct the path to the expected one if the bug were > still with us. > > Signed-off-by: chenjianhu <chenjianhu@kylinos.cn> > ---
[snip]
Show 10 quoted lines
> diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh > index 14b5743b962..f512eed278c 100755 > --- a/t/t7450-bad-git-dotfiles.sh > +++ b/t/t7450-bad-git-dotfiles.sh > @@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d > git -C repo commit -m submodule && > > git -c protocol.file.allow=always clone --recurse-submodules repo bad-clone && > - ! test -f "$PWD/foo" && > + ! test -f "$PWD/bad-clone/sub/foo" &&
Yep, this is the correct path now.
This patch looks good to me. Thanks for fixing :)
-Justin
Show 8 quoted lines
> test -f $(printf "bad-clone/sub\r/post-checkout") > ' > > > base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c > -- > gitgitgadget >