File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1130,6 +1130,9 @@ func UpdatePullRequest(ctx *context.APIContext) {
11301130 if models .IsErrMergeConflicts (err ) {
11311131 ctx .Error (http .StatusConflict , "Update" , "merge failed because of conflict" )
11321132 return
1133+ } else if models .IsErrRebaseConflicts (err ) {
1134+ ctx .Error (http .StatusConflict , "Update" , "rebase failed because of conflict" )
1135+ return
11331136 }
11341137 ctx .Error (http .StatusInternalServerError , "pull_service.Update" , err )
11351138 return
Original file line number Diff line number Diff line change @@ -752,6 +752,21 @@ func UpdatePullRequest(ctx *context.Context) {
752752 ctx .Flash .Error (flashError )
753753 ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
754754 return
755+ } else if models .IsErrRebaseConflicts (err ) {
756+ conflictError := err .(models.ErrRebaseConflicts )
757+ flashError , err := ctx .HTMLString (string (tplAlertDetails ), map [string ]interface {}{
758+ "Message" : ctx .Tr ("repo.pulls.rebase_conflict" , utils .SanitizeFlashErrorString (conflictError .CommitSHA )),
759+ "Summary" : ctx .Tr ("repo.pulls.rebase_conflict_summary" ),
760+ "Details" : utils .SanitizeFlashErrorString (conflictError .StdErr ) + "<br>" + utils .SanitizeFlashErrorString (conflictError .StdOut ),
761+ })
762+ if err != nil {
763+ ctx .ServerError ("UpdatePullRequest.HTMLString" , err )
764+ return
765+ }
766+ ctx .Flash .Error (flashError )
767+ ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
768+ return
769+
755770 }
756771 ctx .Flash .Error (err .Error ())
757772 ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
You can’t perform that action at this time.
0 commit comments