File tree 2 files changed +18
-0
lines changed
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) {
1130
1130
if models .IsErrMergeConflicts (err ) {
1131
1131
ctx .Error (http .StatusConflict , "Update" , "merge failed because of conflict" )
1132
1132
return
1133
+ } else if models .IsErrRebaseConflicts (err ) {
1134
+ ctx .Error (http .StatusConflict , "Update" , "rebase failed because of conflict" )
1135
+ return
1133
1136
}
1134
1137
ctx .Error (http .StatusInternalServerError , "pull_service.Update" , err )
1135
1138
return
Original file line number Diff line number Diff line change @@ -752,6 +752,21 @@ func UpdatePullRequest(ctx *context.Context) {
752
752
ctx .Flash .Error (flashError )
753
753
ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
754
754
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
+
755
770
}
756
771
ctx .Flash .Error (err .Error ())
757
772
ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
You can’t perform that action at this time.
0 commit comments