-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Description
I updated VS Code and GitLens to the latest versions today on Windows 11, and I am now receiving an error when I merge a branch into the current branch. I'm not sure which versions I was on before, but I did not have the issue until updating. Note that I have Git installed in an odd location (D:\Program Files), but I think the same issue would occur if installed in C:\Program Files. To reproduce:
- Right-click on the desired branch and select Switch to Branch...
- Right-click on the branch to merge and select Merge Branch into Current Branch...
- Confirm the merge. The following appeared in the GitLens terminal:
PS D:\AppsWeb\nexus-angular> D:/Program Files/Git/cmd/git.exe -C "d:/AppsWeb/nexus-angular" -c "core.editor=code --wait --reuse-window" merge dev
D:/Program : The term 'D:/Program' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ D:/Program Files/Git/cmd/git.exe -C "d:/AppsWeb/nexus-angular" -c "co ...
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (D:/Program:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I restarted VS Code after I encountered the error the first time, but that did not help. It's obvious that Windows doesn't like the spaces in the path name. (I thought that Windows cmd could find paths like this even without quotes, but apparently that is no longer the case). I expected that adding quotes around the path would fix the issue, but instead it caused git parsing errors:
PS D:\AppsWeb\nexus-angular> "D:/Program Files/Git/cmd/git.exe" -C "d:/AppsWeb/nexus-angular" -c "core.editor=code --wait --reuse-window" merge dev
At line:1 char:36
+ "D:/Program Files/Git/cmd/git.exe" -C "d:/AppsWeb/nexus-angular" -c " ...
+ ~~
Unexpected token '-C' in expression or statement.
At line:1 char:39
+ ... /Program Files/Git/cmd/git.exe" -C "d:/AppsWeb/nexus-angular" -c "cor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '"d:/AppsWeb/nexus-angular"' in expression or statement.
At line:1 char:66
+ ... ogram Files/Git/cmd/git.exe" -C "d:/AppsWeb/nexus-angular" -c "core.e ...
+ ~~
Unexpected token '-c' in expression or statement.
At line:1 char:69
+ ... eb/nexus-angular" -c "core.editor=code --wait --reuse-window" merge d ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '"core.editor=code --wait --reuse-window"' in expression or statement.
At line:1 char:110
+ ... /nexus-angular" -c "core.editor=code --wait --reuse-window" merge dev
+ ~~~~~
Unexpected token 'merge' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
The merge was successful after removing the full path from git.exe, because D:\Program Files\Git\cmd is in my Windows path.
git.exe -C "d:/AppsWeb/nexus-angular" -c "core.editor=code --wait --reuse-window" merge dev
GitLens Version
13.6.0
VS Code Version
Version: 1.78.2 (system setup)
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:39:26.248Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: Yes
Git Version
git version 2.37.3.windows.1
Logs, Screenshots, Screen Captures, etc
No response