fix(gix): ignore incomplete linked worktrees during fetch - #2960
Merged
Conversation
<!-- agent --> Expose `worktree::Proxy::is_prunable()` with Git-compatible semantics: locked worktrees are retained, while unreadable `gitdir` files and missing checkout targets are prunable. Treat any filesystem entry at `locked` as a lock, including symlinks. When opening a proxy as a repository, use the common directory already known by its parent instead of relying on the linked worktree’s optional `commondir` file. This prevents incomplete administration from being mistaken for a standalone repository and keeps `HEAD` access routed through the repository ref store for backend compatibility. Fetch can consequently inspect linked-worktree heads without failing for missing checkouts, locks, or missing and malformed `commondir` files. Assisted-by: Codex <codex@openai.com> Co-authored-by: GPT 5.6 <codex@openai.com>
Sebastian Thiel (Byron)
force-pushed
the
fetch-in-linked-wt
branch
from
September 2, 2026 07:56
73500b1 to
0af2f91
Compare
Sebastian Thiel (Byron)
marked this pull request as ready for review
September 2, 2026 08:19
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.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Summary
gitdirbut notcommondirwhile collecting checked-out branches.Fixes #2959
Git reference
Validated the reported scenario with Git 2.55.0 from
/Users/byron/dev/github.com/git/gitat0bd5a6920d7c4238e0d90ddc0e7e08866e84a0f1. Git reports the incomplete entry asprunable, completesgit fetchwith exit status 0, and creates the remote-tracking ref. Itsadd_worktree()implementation writesgitdirbeforecommondir.Validation
cargo fmt --all -- --checkcargo test -p gix --lib --features blocking-network-client(23 passed)cargo test -p gix --test gix(409 passed)cargo clippy -p gix --lib --features blocking-network-clientCommits
d27ee0843f— fix(gix): ignore incomplete linked worktrees during fetch (gix:fetchfails when a linked worktree admin dir has agitdirfile but nocommondir#2959)73500b11a8— Preserve linked-worktree open errors