You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git has a new ref backend called reftable. When that's used, the ref data and reflogs are stored inside a set of binary files and the .git/HEAD file always contains ref: refs/heads/.invalid (note that .invalid is not permitted in a real refname).
As a result, calling FugitiveHead returns .invalid, which is not correct. This also causes Airline to reflect the incorrect branch name.
To reproduce this situation, you can set up a repository with Git 2.48 and this shell script:
#!/bin/sh
git init -b dev --ref-format=reftable test-repo
cd test-repo
touch abc.txt
git add abc.txt
git commit -m +
Once inside, you can open Vim with Fugitive enabled and run :call FugitiveHead(). The correct result is dev, and the incorrect result is .invalid.
I suspect you are going to need to actually invoke Git in this case. Perhaps a command like git rev-parse --abbrev-ref HEAD will be useful.
The text was updated successfully, but these errors were encountered:
Git has a new ref backend called
reftable
. When that's used, the ref data and reflogs are stored inside a set of binary files and the.git/HEAD
file always containsref: refs/heads/.invalid
(note that.invalid
is not permitted in a real refname).As a result, calling
FugitiveHead
returns.invalid
, which is not correct. This also causes Airline to reflect the incorrect branch name.To reproduce this situation, you can set up a repository with Git 2.48 and this shell script:
Once inside, you can open Vim with Fugitive enabled and run
:call FugitiveHead()
. The correct result isdev
, and the incorrect result is.invalid
.I suspect you are going to need to actually invoke Git in this case. Perhaps a command like
git rev-parse --abbrev-ref HEAD
will be useful.The text was updated successfully, but these errors were encountered: