Skip to content

Commit

Permalink
(+semver: fix) Check remotes for master ref is heads failed (#16)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <[email protected]>
  • Loading branch information
annymsMthd authored Apr 8, 2019
1 parent e0cb350 commit 7da142a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func getVersion(r *git.Repository, h *plumbing.Reference, tagMap map[string]stri

masterHead, err := r.Reference("refs/heads/master", false)
if err != nil {
return nil, errors.Wrap(err, "getVersion failed")
masterHead, err = r.Reference("refs/remotes/origin/master", false)
if err != nil {
return nil, errors.Wrap(err, "failed to get master branch at 'refs/heads/master, 'refs/remotes/origin/master'")
}
}

masterCommit, err := r.CommitObject(masterHead.Hash())
Expand Down

0 comments on commit 7da142a

Please sign in to comment.