Skip to content

fix(worktree): normalize Windows managed paths - #2254

Merged
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:bob/fix-windows-worktree-path
Aug 13, 2026
Merged

fix(worktree): normalize Windows managed paths#2254
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:bob/fix-windows-worktree-path

Conversation

@bobleer

Copy link
Copy Markdown
Collaborator

Summary

  • convert Windows canonical managed-worktree roots from verbatim \\?\C:\... form to the compatible drive-letter form before constructing the Git target
  • preserve canonical containment and symlink checks
  • add a Windows-only regression asserting the target passed to Git never becomes //?/...

Fixes#2249

Root cause

tokio::fs::canonicalize returns a verbatim path on Windows. The managed-worktree flow then normalized backslashes for the Git CLI, turning \\?\C:\... into //?/C:/...; Git for Windows rejected that target while creating the linked worktree .git file.

Verification

  • cargo test -p bitfun-core --no-default-features --features agent-runtime,git --lib service::worktree::tests:: (22 passed on macOS)
  • pnpm run check:repo-hygiene
  • git diff --check
  • attempted a macOS-to-x86_64-pc-windows-msvc check; the host lacks the MSVC C headers required by libsqlite3-sys/libz-sys, so native Windows CI owns that platform run

Managed worktrees remain explicitly unsupported for remote workspaces, so this change was exercised only in the local-workspace path.

AI assistance

AI-assisted; locally tested as listed above, with the Windows-specific regression delegated to the native CI matrix.

@bobleer
bobleer merged commit 9848f7a into GCWing:mainAug 13, 2026
7 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: worktree 功能好像不能用了

1 participant

@bobleer