Skip to content

Commit

Permalink
Remove 422 error logging (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
shravan1k authored Jun 28, 2022
1 parent be48b96 commit b33eb15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bulldozer/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ func (m *GitHubMerger) defaultMerge(ctx context.Context, pullCtx pull.Context, m

func (m *GitHubMerger) DeleteHead(ctx context.Context, pullCtx pull.Context) error {
_, head := pullCtx.Branches()
_, err := m.client.Git.DeleteRef(ctx, pullCtx.Owner(), pullCtx.Repo(), fmt.Sprintf("refs/heads/%s", head))
resp, err := m.client.Git.DeleteRef(ctx, pullCtx.Owner(), pullCtx.Repo(), fmt.Sprintf("refs/heads/%s", head))
// Disregard the error since Github may delete the branch before we do
if resp.StatusCode == http.StatusUnprocessableEntity {
return nil
}
return errors.WithStack(err)
}

Expand Down

0 comments on commit b33eb15

Please sign in to comment.