Skip to content

fix(core): initialize submodules in new worktrees#8

Merged
AlecRust merged 1 commit into
AlecRust:mainfrom
asainz:initialize-worktree-submodules
Apr 30, 2026
Merged

fix(core): initialize submodules in new worktrees#8
AlecRust merged 1 commit into
AlecRust:mainfrom
asainz:initialize-worktree-submodules

Conversation

@asainz

@asainz asainz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Current problem

Creating a managed worktree leaves submodule directories uninitialized because git worktree add does not honor submodule.recurse for initial submodule setup.

Proposed solution

After creating a worktree, detect repositories with .gitmodules and run git submodule update --init --recursive inside the new worktree. Add a regression test with a real local submodule fixture.

# Current problem

Creating a managed worktree leaves submodule directories uninitialized because git worktree add does not honor submodule.recurse for initial submodule setup.

# Proposed solution

After creating a worktree, detect repositories with .gitmodules and run git submodule update --init --recursive inside the new worktree. Add a regression test with a real local submodule fixture.
@AlecRust

Copy link
Copy Markdown
Owner

Thank you for your contribution!

@AlecRust AlecRust merged commit 185af06 into AlecRust:main Apr 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants