Function
shouldFallbackToCurrentBranch
(repo *git.Repository, err error)
Source from the content-addressed store, hash-verified
| 740 | } |
| 741 | |
| 742 | func shouldFallbackToCurrentBranch(repo *git.Repository, err error) bool { |
| 743 | if !errors.Is(err, transport.ErrAuthenticationRequired) && !errors.Is(err, transport.ErrEmptyRemoteRepository) { |
| 744 | return false |
| 745 | } |
| 746 | _, headErr := repo.Head() |
| 747 | return headErr == nil |
| 748 | } |
| 749 | |
| 750 | // checkoutRemoteDefaultBranch ensures the working tree is checked out to the remote's default branch |
| 751 | // (the branch target of origin/HEAD). If the local branch does not exist it will be created to track |
Tested by
no test coverage detected