Re: [PATCH] modify the “foo" file path to "$PWD/bad-clone/sub/foo".
From: Justin Tobler <hidden>
Date: 2025-07-30 18:14:11
On 25/07/30 08:47AM, Junio C Hamano wrote:
"陈建虎 via GitGitGadget" [off-list ref] writes:quoted
From: =?UTF-8?q?=E9=99=88=E5=BB=BA=E8=99=8E?= <redacted>Justin, who wrote the test originally, Cc'ed for comments.quoted
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" &&
This assertion is supposed to validate that the post-checkout hook did not execute. The path here is incorrect indeed. I've tested the fix here and it works as expected. Thanks
quoted
test -f $(printf "bad-clone/sub\r/post-checkout")
The second assertion here still demonstrates that a file was not checked out into an arbitrary location, which is the root of the problem, and likely why I missed this. Apologies. -Justin