Repository navigation
worktree checkout fixes windows - #3057
Conversation
52584b9 to
f7b4c47
Compare
<!-- agent --> Windows symlink creation inferred the target type with a filesystem probe. Git for Windows guards that probe because a leading slash or backslash can introduce a network share, including UNC and NT namespace spellings, whose resolution could disclose credentials. Match `process_phantom_symlink()` in Git's `compat/mingw.c` by checking the original target spelling before probing it and creating a file link for these targets. Relative and drive-qualified local targets retain directory detection. This also deliberately treats drive-less rooted and verbatim local targets as files, matching the conservative Git rule. The regression uses only local directories with slash, backslash, and verbatim spellings. It fails before the guard and passes afterward. This is a focused safety hardening based on source review. Assisted-by: GPT 6.1 Sol
<!-- agent --> Delaying symlinks until regular files are written is insufficient on Windows: an early link can target another link that has not been created yet. A single target probe then leaves a file link where a directory link is required, making paths such as `a-child -> z-dir/nested` unusable. Git for Windows retries unresolved links when directory links appear. Add `gix_fs::symlink::create_or_delay()` and retry unresolved checkout entries while other links make progress. When a pass makes no progress, create the remaining dangling or cyclic links with the existing file fallback. Completed links need no removal or recreation. For forced overwrites, try creation before unlinking so a deferred replacement leaves the existing link intact if a later object error aborts checkout. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
f7b4c47 to
3909fb6
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3909fb6928
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
<!-- agent --> `gix_worktree_state::checkout()` stops dispatching entries when interrupted but deliberately returns a partial `Ok` outcome. Clone checkout follows that contract: it writes the index and returns the fetched repository even when the worktree is incomplete. Treating interruption as an error would otherwise trigger cleanup of an initially empty clone destination on drop and require repeating the fetch. Keep the existing behavior and document that callers must inspect `should_interrupt` after `PrepareCheckout::main_worktree()` returns. Neither `Ok` nor an outcome without errors guarantees a complete checkout. Explain index persistence, retention of the fetched repository and partial worktree, and how to finish checkout without fetching again. Clarify that returning `Ok` consumes the preparation even after interruption. Add isolated tests for interruption requested before checkout or inside the checkout engine. Verify the partial outcome, persisted HEAD-tree index, incomplete worktree, and retained repository and objects after drop. Also cover cleanup of an initially empty destination when writing the index fails, distinguishing ordinary errors from partial `Ok`. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Tasks