Closed derrickstolee closed 4 years ago
the proper way to detect the default branch name after a clone.
I think it is symbolic-ref
:
$ git -c init.defaultBranch=monkey init money
Initialized empty Git repository in C:/git-sdk-64/tmp/money/.git/
$ git -C money symbolic-ref HEAD
refs/heads/monkey
FTR there is also usually a refs/remotes/origin/HEAD
that is also a symbolic ref, pointing to the remote ref reflecting the default branch.
If we use
scalar clone <url>
for a repository that does not include amaster
branch, then we get this error:We should respect the default branch name discovered during clone.
(This affects the non-GVFS Protocol case as well.)
cc: @dscho for advice for the proper way to detect the default branch name after a clone.