Skip to content

Conversation

@LeeWorrall
Copy link
Contributor

As of 5.10 jgit reads symrefs in pack capabilities and FetchResult can tell you the default branch.

If the FetchResult HEAD is a SymbolicRef then that is the default branch, build that,
else if there is a master which points to the same object as HEAD, build that,
else look for any branch that points to the same object as HEAD and build that.

That's the same logic as clone uses to determine which branch to start on.

If the FetchResult HEAD is a SymbolicRef then that is the default branch, build that,
else if there is a master which points to the same object as HEAD, build that,
else look for any branch that points to the same object as HEAD and build that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant