Skip to content

Resolve git config path for worktree workspaces#43

Merged
jhrozek merged 1 commit intomainfrom
worktree
Mar 16, 2026
Merged

Resolve git config path for worktree workspaces#43
jhrozek merged 1 commit intomainfrom
worktree

Conversation

@jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Mar 16, 2026

In a worktree .git is a file pointing to the main repo's gitdir, not a directory. ReadFile(.git) to detect this, follow the gitdir and commondir chain to the shared config, and replace the stale pointer file in the snapshot so MkdirAll can create .git/config.

In a worktree .git is a file pointing to the main repo's gitdir,
not a directory. ReadFile(.git) to detect this, follow the gitdir
and commondir chain to the shared config, and replace the stale
pointer file in the snapshot so MkdirAll can create .git/config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jhrozek jhrozek merged commit d3af592 into main Mar 16, 2026
7 checks passed
@jhrozek jhrozek deleted the worktree branch March 16, 2026 11:25
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