Skip to content

Commit b33eb15

Browse files
authored
Remove 422 error logging (#323)
1 parent be48b96 commit b33eb15

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bulldozer/merge.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ func (m *GitHubMerger) defaultMerge(ctx context.Context, pullCtx pull.Context, m
103103

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

0 commit comments

Comments
 (0)