Description
Creating a worktree through Fork fails when a WSL repository is opened using the \\wsl$\Ubuntu\... UNC alias. Fork appears to normalize the destination into //wsl$/..., which wslgit does not translate correctly. Reopening the same repository through \\wsl.localhost\Ubuntu\... makes worktree creation succeed.
This was found while evaluating Fork. The workaround is effective, but the two equivalent WSL UNC aliases behave differently.
Environment
- Fork 2.21.0.0 for Windows (Develop update channel)
- Windows 11
- WSL2, Ubuntu
- Custom Git executable:
C:\Repos\z.Tools\wslgit\bin\git.exe
- Repository:
/home/daniel/repos/ConstructBuy
Reproduction
- Configure Fork to use
C:\Repos\z.Tools\wslgit\bin\git.exe.
- Open the repository as
\\wsl$\Ubuntu\home\daniel\repos\ConstructBuy.
- Use Fork to create a new branch and worktree named
test, with the destination \\wsl$\Ubuntu\home\daniel\repos\ConstructBuy-worktrees\test.
Expected
Fork should create the worktree, just as it does when the same repository and destination are addressed through \\wsl.localhost\Ubuntu\....
Actual
Fork logs this command and failure:
Git request failed 'worktree add -b test //wsl$/Ubuntu/home/daniel/repos/ConstructBuy-worktrees/test 09873c7160a3299863f625695bd25085bf917dad':
wslpath: //wsl\\$/Ubuntu/home/daniel/repos/ConstructBuy-worktrees/test
Preparing worktree (new branch 'test')
BUG: builtin/worktree.c:449: How come '' becomes empty after sanitization?
The worktree is not created.
Workaround
Remove/reopen the repository in Fork using:
\\wsl.localhost\Ubuntu\home\daniel\repos\ConstructBuy
With that alias, Fork can successfully create the worktree.
Related issues
Description
Creating a worktree through Fork fails when a WSL repository is opened using the
\\wsl$\Ubuntu\...UNC alias. Fork appears to normalize the destination into//wsl$/..., which wslgit does not translate correctly. Reopening the same repository through\\wsl.localhost\Ubuntu\...makes worktree creation succeed.This was found while evaluating Fork. The workaround is effective, but the two equivalent WSL UNC aliases behave differently.
Environment
C:\Repos\z.Tools\wslgit\bin\git.exe/home/daniel/repos/ConstructBuyReproduction
C:\Repos\z.Tools\wslgit\bin\git.exe.\\wsl$\Ubuntu\home\daniel\repos\ConstructBuy.test, with the destination\\wsl$\Ubuntu\home\daniel\repos\ConstructBuy-worktrees\test.Expected
Fork should create the worktree, just as it does when the same repository and destination are addressed through
\\wsl.localhost\Ubuntu\....Actual
Fork logs this command and failure:
The worktree is not created.
Workaround
Remove/reopen the repository in Fork using:
With that alias, Fork can successfully create the worktree.
Related issues