fix: Recognize relative worktrees extension#7254
Merged
Merged
Conversation
Git supports relative worktrees since Git v2.48 - https://github.com/git/git/blob/cf6f63ea6bf35173e02e18bdc6a4ba41288acff9/Documentation/RelNotes/2.48.0.adoc?plain=1#L57 This was already handled programatically in libgit2, but was not recognized as an extension, meaning downstream consumers like Nix had issues with relative worktree-enabled repos. Fixes libgit2#7210
Member
|
Really helpful, thanks for this. Should we turn off relative worktree support if this isn't specified? 🤔 I'm curious what git does here. |
Contributor
Author
Should be fine - git doesn't even check for this flag when resolving worktree paths - it resolves the paths (just like libgit2 does). The extension is for older versions to just refuse to deal with the repo if it doesn't understand it (what happened with nix) - https://github.com/git/git/blob/94f057755b7941b321fd11fec1b2e3ca5313a4e0/worktree.c#L158-L162 |
Member
|
Makes sense; thanks! |
This was referenced May 12, 2026
This was referenced May 12, 2026
Merged
1 task
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.
Git supports relative worktrees since Git v2.48 - https://github.com/git/git/blob/cf6f63ea6bf35173e02e18bdc6a4ba41288acff9/Documentation/RelNotes/2.48.0.adoc?plain=1#L57
This was already handled programatically in libgit2, but was not recognized as an extension, meaning downstream consumers like Nix had issues with relative worktree-enabled repos.
Fixes #7210