-
-
Notifications
You must be signed in to change notification settings - Fork 284
posh-git prompt with detached head adds to $global:error.Count #27
Comments
I like the skull. I really do. But it's a posh-git error on this line.
This means we either create an issue over there (or a PR with a fix :-)) |
Thanks for analyzing that. My skills are too limited to submit a PR. Even submitting a proper issue is hard, i do not know to even get the error message you quoted on the screen. |
You can get the errors thrown in PowerShell by looking at the $error object. It's what I use to determine whether or not the last command failed ($lastexitcode is unreliable). I'm looking for a way to adjust those git commands in a way where they no longer throw an error but rather the commit hash. But that might break other stuff, so I have to dig a bit deeper 😎 |
I looked at the code at bit more and I can't seem to find a solution for this. It will iterate over a few options and return the first one that does not return NULL. The problem is that the first one |
I fixed it and created a PR over at posh-git. |
Thanks for not only fixing bugs in other projects but also educating me about Powershell along the way. 👍 I think the issue can be closed over here? |
I'd leave it open for people to find in case they notice the same issue. It won't be resolved until the PR is accepted at posh-git, which will not be anytime soon looking at their response times 😎. And you are welcome! |
PR closed at posh-git. |
I notice that
$global:error.Count
constantly increases when just pressing the return key in a git versioned directory with detached head:This triggers an perpetual display of the FailedCommand-Character (skull in my case). I could not reproduce that in other git versioned directories, so i assume it has to do with the detached head. Not sure if that is an posh-git-issue...
The text was updated successfully, but these errors were encountered: