fix: bare worktree regression after bump to gix v0.85#193
Merged
junglerobba merged 2 commits intoJul 7, 2026
Conversation
junglerobba
approved these changes
Jul 7, 2026
| match self { | ||
| RepoProvider::Git(repo) => { | ||
| matches!(repo.kind(), gix::repository::Kind::LinkedWorkTree) | ||
| || repo.workdir().is_some_and(|wd| wd.join(".git").is_file()) |
Collaborator
There was a problem hiding this comment.
can we add a comment here that this is (probably) a temp workaround that should be dropped eventually?
…dows Regression caused by jrmoulton#192 and API change in gix 0.85: `Repository::kind()` returns Kind::Common for bare worktrees instead of Kind::LinkedWorkTree. When this is fixed, the change to `is_worktree()` marked with todo can be reverted.
Regression caused by jrmoulton#192 and API change in gix 0.85: `is_bare()` now returns true despite the worktree having a checkout, so this meant the session working dir is $GIT_DIR/worktrees/<name> instead of the path to the worktree.
227c017 to
99dbb37
Compare
Collaborator
|
Thanks! Only applied some slight commit reorganization to keep the fixes in their own commits. |
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.
Regressions
#192 introduced two regressions for bare worktrees:
$GIT_DIR/worktrees/<name>instead of the path to the worktree.Cause
gix 0.85 has two API changes:
Repository::kind()returns Kind::Common for bare worktrees instead of Kind::LinkedWorkTree.is_bare()returnstruedespite the worktree having a checkout.I'm pretty sure (1) is a gix bug. I made a PR to gix which should hopefully fix things! When that happens, we can revert the change to
is_worktree(). Seems like (2) is an intentional API change.Steps to Reproduce
Before
After