Skip to content

fix: support git worktree by using --git-common-dir for storage path#17

Merged
ushmz merged 1 commit into
mainfrom
fix/worktree-plugin-loading
Feb 24, 2026
Merged

fix: support git worktree by using --git-common-dir for storage path#17
ushmz merged 1 commit into
mainfrom
fix/worktree-plugin-loading

Conversation

@ushmz

@ushmz ushmz commented Feb 24, 2026

Copy link
Copy Markdown
Owner

In a git worktree, .git is a file (gitfile) pointing to the actual git directory, not a directory itself. The previous implementation built the storage path as git_root/.git/tabi, which tried to create a subdirectory inside a file and caused an error on plugin load.

Fix by adding utils.get_git_common_dir() that calls git rev-parse --git-common-dir, which correctly resolves both normal repos (returns .git) and worktrees (returns the main repo's .git directory as an absolute path). The storage path is now computed as git_common_dir/tabi so worktrees share session data with the main repository's .git directory.

In a git worktree, .git is a file (gitfile) pointing to the actual git
directory, not a directory itself. The previous implementation built the
storage path as `git_root/.git/tabi`, which tried to create a
subdirectory inside a file and caused an error on plugin load.

Fix by adding `utils.get_git_common_dir()` that calls
`git rev-parse --git-common-dir`, which correctly resolves both normal
repos (returns `.git`) and worktrees (returns the main repo's .git
directory as an absolute path). The storage path is now computed as
`git_common_dir/tabi` so worktrees share session data with the main
repository's .git directory.
@ushmz ushmz merged commit 611974e into main Feb 24, 2026
4 checks passed
@ushmz ushmz deleted the fix/worktree-plugin-loading branch February 24, 2026 12:45
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.

1 participant