Open eekboom opened 3 years ago
I do not have such a setup available to test. If you do have any suspicions what could cause the issues here, feedback would be very welcome.
I assume that the gerrit plugin is using the "normal" project path as seen by Windows:
//wsl$/Ubuntu-20.04/home/stephen/dev/work/acme
However, IDEA executes the git command directly in the linux subsystem, so the prefix must be removed: /home/stephen/dev/work/acme
I would guess that there is some logic in IDEA itself that handles this translation of file paths. I am not sure, if it is always so easy as just remove the //wsl$/
prefix and the first component after that.
Thanks for your feedback. Do you know if any other Git operation executed directly by IntelliJ works as expected? Do only plugin triggered Git operations fail?
Yes, it seems that way: The standard git operations like fetch and push work fine. However it seems that the command lines for that command do not include the file path at all (instead the commands are just executed with the current directory == project path). It's only the gerrit plugin triggered actions that fail.
IDEA is clever enough to open projects correctly even if they are in the WSL2 file system (using the \wsl$.., path prefix). For git operations it then directly uses the git client installed in the wsl subsystem.
However when I try to check out a gerrit change using the plugin, then the project path is wrong and the operations fails with "Invalid reference: FETCH_HEAD". From IDEAs git Console log:
IDEA executes that command directly in wsl2/Ubuntu, so paths there should not contain the "//wsl$/Ubuntu-20.04" prefix. When I try this on the wsl2 command line, it works fine: