-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes in git not detected if root contains file named HEAD #517
Comments
liquidprompt 1.11 is 25 commits behind master. You should update and try to reproduce. I have the same version of git, and cannot reproduce this problem. Note that the original line is a diff between the working directory and the HEAD commit. Your amended line is a diff between the working directory and the staging area. There should be no change in behavior between different git versions. |
@Rycieos thank you your you prompt :-) answer. You're completely right, I rewrote the issue. The problem is that I had a file named HEAD. |
An interesting issue. Not strictly relevant, but why do you have a file named "HEAD"? There very well might be many more locations where this could be a problem. Anywhere that a HEAD, master, or origin is referenced might break in a similar way. Maybe it's worth it to evaluate other such possible problem locations? |
I just pushed a commit to the master branch fixing this. Sorry for the delay! I tested all our other |
"git diff" can take both refs and filenames, so if there a file named HEAD, it would error not knowing which you wanted. Add the notation to tell git we want the ref. I checked and tested all the other git calls we are using, and this was the only one that could take both filenames and refs, so therefore the only one that needed changes. Fixes liquidprompt#517
Shell: bash
Operating system: OSX 10.12.4
Liquid Prompt version (tag, commit): 1.11
when there are git changes on a git checkout whose root contains a file named HEAD, the prompt does not display them (remains in green).
Problem is with line 929
shortstat="$(LC_ALL=C \git diff --shortstat HEAD 2>/dev/null)"
This is because git does not know if we refer to the HEAD file or the HEAD revision
I suggest this patch
shortstat="$(LC_ALL=C \git diff --shortstat HEAD -- 2>/dev/null)"
The text was updated successfully, but these errors were encountered: