Handle Bitbucket mercurial hooks correctly

This commit is contained in:
Jyrno Ader 2016-04-17 08:15:10 +03:00
parent 078597261f
commit 127f239493

View file

@ -414,10 +414,10 @@ func (bb *Bitbucket) pushHook(r *http.Request) (*model.Repo, *model.Build, error
// we only support tag and branch pushes for now // we only support tag and branch pushes for now
buildEventType := model.EventPush buildEventType := model.EventPush
buildRef := fmt.Sprintf("refs/heads/%s", change.New.Name) buildRef := fmt.Sprintf("refs/heads/%s", change.New.Name)
if change.New.Type == "tag" || change.New.Type == "annotated_tag" { if change.New.Type == "tag" || change.New.Type == "annotated_tag" || change.New.Type == "bookmark" {
buildEventType = model.EventTag buildEventType = model.EventTag
buildRef = fmt.Sprintf("refs/tags/%s", change.New.Name) buildRef = fmt.Sprintf("refs/tags/%s", change.New.Name)
} else if change.New.Type != "branch" { } else if change.New.Type != "branch" && change.New.Type != "named_branch" {
continue continue
} }