Closed mmalolepszy closed 2 years ago
I suppose this is a regression caused by this commit: https://github.com/JanDeDobbeleer/oh-my-posh/commit/2733865edf050e4e47f899cdb0bec45916a242ff
It's related to the recent refactor of the git segment. Let's check where it comes from.
@lnu I didn't adjust that part though.
If i build this commit 4f921dbb0f94cd68757360a94b15cc51b205b305 it works as expected and worktree Folder is empty. With the latest version worktree is set.
So it comes from here: https://github.com/JanDeDobbeleer/oh-my-posh/blob/adb49d1cd0b15de9adc5415809cec0611868ae1d/src/segment_git.go#L146
g.gitWorktreeFolder
is always initialized event when not in a worktree. It was not the case before:
@lnu aha! That's because doing this I didn't have a status when referencing another directory than the one I'm in. But I'll approve :-)
you're right, let's see how to fix this
If I remember well, we did that to speed up things but in the end, it should be clear that no one should use git in wsl2 and windows mounted folders. The rule should be:
this way it will be fast everywhere except when using mounted folder in wsl2.
I don't think it's up to omp to try to solve that, can of worms ahead.
What do you think @JanDeDobbeleer ?
@lnu I agree. We can't solve problems outside of our control.
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
When working in WSL shared folder git command executed is:
this command fails with
The issue is that when git segment falls back to using
git.exe
instead of linuxgit
it should also translate the path to Windows style path.This command runs perfectly fine even when it is run in WSL bash:
Theme
This can be reproduced on a default
jandedobbeleer.omp.json
themeWhat OS are you seeing the problem on?
Windows
Which shell are you using?
bash
Log output