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.
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/HEADfile always containsref: refs/heads/.invalid(note that.invalidis not permitted in a real refname).As a result, calling
FugitiveHeadreturns.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 HEADwill be useful.