You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is a space in a folder within the current working directory, the Worktrees feature fails to list out the existing worktrees, rendering the feature useless.
For example, within the following directory: /Users/koolstr/Documents/Projects/Example Project/example-project
The following errors are produced: [2022-03-01 22:35:31.483] [GIT ] [/Users/koolstr/Documents/Projects/Example Project/example-project] git worktree list --porcelain • 32 ms [2022-03-01 22:35:31.497] [GIT ] [/Users/koolstr/Documents/Projects/Example] git status --porcelain=v2 --branch -u --find-renames -- • The value of "err" is out of range. It must be a negative integer. Received 1 • 7 ms [2022-03-01 22:35:31.497] [ 1147] LocalGitProvider.getStatusForRepo — failed • 9 ms RangeError [ERR_OUT_OF_RANGE]: The value of "err" is out of range. It must be a negative integer. Received 1 (This error gets shown as a notification within the VS Code UI)
As you can see, the actual working path is cut off by the positional parameters sent from the git worktree list command, which delimit the path by spaces into separate parameters. The git status call only operates on that first positional parameter as the working path, which is an incorrect partial path.
To fix this, you can make an equivalent of this patch I recently made for this exact issue in another project.
GitLens Version: 12.0.0
Git Version: 2.33.1
VSCode Version: 1.64.2
OS Version: macOS Catalina 10.15.7
The text was updated successfully, but these errors were encountered:
How can I checkout that branch? I'm getting an error that the branch is already checked in in the worktree folder but I can't switch the worktree because of this bug.
If there is a space in a folder within the current working directory, the Worktrees feature fails to list out the existing worktrees, rendering the feature useless.
For example, within the following directory:
/Users/koolstr/Documents/Projects/Example Project/example-project
The following errors are produced:
[2022-03-01 22:35:31.483] [GIT ] [/Users/koolstr/Documents/Projects/Example Project/example-project] git worktree list --porcelain • 32 ms
[2022-03-01 22:35:31.497] [GIT ] [/Users/koolstr/Documents/Projects/Example] git status --porcelain=v2 --branch -u --find-renames -- • The value of "err" is out of range. It must be a negative integer. Received 1 • 7 ms
[2022-03-01 22:35:31.497] [ 1147] LocalGitProvider.getStatusForRepo — failed • 9 ms
RangeError [ERR_OUT_OF_RANGE]: The value of "err" is out of range. It must be a negative integer. Received 1
(This error gets shown as a notification within the VS Code UI)As you can see, the actual working path is cut off by the positional parameters sent from the
git worktree list
command, which delimit the path by spaces into separate parameters. Thegit status
call only operates on that first positional parameter as the working path, which is an incorrect partial path.To fix this, you can make an equivalent of this patch I recently made for this exact issue in another project.
The text was updated successfully, but these errors were encountered: