fix: support git worktree by using --git-common-dir for storage path#16
Closed
ushmz wants to merge 1 commit into
Closed
fix: support git worktree by using --git-common-dir for storage path#16ushmz wants to merge 1 commit into
ushmz wants to merge 1 commit into
Conversation
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. https://claude.ai/code/session_01KDTT5rt4gAzW8BkPFmvA9G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asubdirectory inside a file and caused an error on plugin load.
Fix by adding
utils.get_git_common_dir()that callsgit rev-parse --git-common-dir, which correctly resolves both normalrepos (returns
.git) and worktrees (returns the main repo's .gitdirectory as an absolute path). The storage path is now computed as
git_common_dir/tabiso worktrees share session data with the mainrepository's .git directory.
https://claude.ai/code/session_01KDTT5rt4gAzW8BkPFmvA9G