[PATCH 0/3] submodule: support linked worktrees in recursive checkout
- From
Adrian Ratiu <adrian.ratiu@collabora.com>
- Date
- Nov 18, 2026, 16:32 UTC
- Message-ID
- <20261118163249.1693361-1-adrian.ratiu@collabora.com>
- In-Reply-To
- <avuJBGlB3pRU3JU0@pampelmuse>
Hello all,
This fixes a few submodule bugs reported by Andreas at: https://lore.kernel.org/git/avuJBGlB3pRU3JU0@pampelmuse/
In short: when a submodule is a linked worktree of its repository ("git worktree add" inside the submodule), a recursive checkout in the superproject either crashes with a BUG() or leaves the submodule broken.
The patches should be self-explanatory, many thanks to Andreas for reporting and sharing a reproducer.
Regards, Adrian
Adrian Ratiu (3): submodule: return an error instead of BUG() for an unexpected git dir submodule: only suggest submodulePathConfig when it is disabled submodule: accept a linked worktree as the submodule's git dir
submodule.c | 72 +++++++++++++++++++--- t/t2405-worktree-submodule.sh | 40 ++++++++++++ t/t7425-submodule-gitdir-path-extension.sh | 14 +++++ t/t7450-bad-git-dotfiles.sh | 31 ++++++++++ 4 files changed, 148 insertions(+), 9 deletions(-)
base-commit: e1ec09b23c8e0deb21a0b95ac5996422277395d4
-- 2.56.1