Ensure that rebase conflicts are handled in updates (#16952) #16960

Merged
lunny merged 2 commits from backport-16952-v1.15 into release/v1.15 2021-09-05 16:54:13 +00:00
Contributor

Backport #16952

PR #16125 did not update the error handlers to handle conflict errors relating
to rebases. This PR adds them.

Fix #16922

Signed-off-by: Andrew Thornton art27@cantab.net

Backport #16952 PR #16125 did not update the error handlers to handle conflict errors relating to rebases. This PR adds them. Fix #16922 Signed-off-by: Andrew Thornton <art27@cantab.net>
6543 (Migrated from github.com) approved these changes 2021-09-05 10:15:37 +00:00
axifive (Migrated from github.com) approved these changes 2021-09-05 16:48:57 +00:00
@ -1130,6 +1130,9 @@ func UpdatePullRequest(ctx *context.APIContext) {
if models.IsErrMergeConflicts(err) {
ctx.Error(http.StatusConflict, "Update", "merge failed because of conflict")
return
} else if models.IsErrRebaseConflicts(err) {
axifive (Migrated from github.com) commented 2021-09-05 16:48:45 +00:00

same

		} 
		if models.IsErrRebaseConflicts(err) {
same ```suggestion } if models.IsErrRebaseConflicts(err) { ```
@ -752,6 +752,21 @@ func UpdatePullRequest(ctx *context.Context) {
ctx.Flash.Error(flashError)
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + fmt.Sprint(issue.Index))
return
} else if models.IsErrRebaseConflicts(err) {
axifive (Migrated from github.com) commented 2021-09-05 16:46:03 +00:00

I think, "else" can be omitted

		}
		if models.IsErrRebaseConflicts(err) {
I think, "else" can be omitted ```suggestion } if models.IsErrRebaseConflicts(err) { ```
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#16960
No description provided.