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 storage backend called reftable that stores all refs,
including HEAD, as well as all reflogs, in a binary format under
.git/reftable. Because the HEAD file is important in determining
whether a directory is a Git repository, Git retains this file, but it
always contains "ref: refs/heads/.invalid", thus pointing to an invalid
ref, since ref components may not start with a dot.
In such a configuration, the only practical possibility is to invoke a
Git command to resolve HEAD for us, so use git rev-parse to do so if we
find this invalid ref in the HEAD file. Look up the object ID and the
value for HEAD at the same time to avoid the overhead of two calls and
use the former if the latter is HEAD (that is, we're not on a branch).
Unfortunately, this doesn't work when we have an unborn branch without
any commits, such as when a repository is newly initialized. Fall back
to git symbolic-ref in such a case.
Use the regular head cache, as well as a new reftable head cache that
tracks .git/reftable/tables.list. The reftable format uses several
binary files plus a list of tables and the table list will change
whenever a regular ref or symref (including HEAD) changes, which is what
we want to know.
0 commit comments