File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1136,6 +1136,9 @@ func UpdatePullRequest(ctx *context.APIContext) {
11361136 if models .IsErrMergeConflicts (err ) {
11371137 ctx .Error (http .StatusConflict , "Update" , "merge failed because of conflict" )
11381138 return
1139+ } else if models .IsErrRebaseConflicts (err ) {
1140+ ctx .Error (http .StatusConflict , "Update" , "rebase failed because of conflict" )
1141+ return
11391142 }
11401143 ctx .Error (http .StatusInternalServerError , "pull_service.Update" , err )
11411144 return
Original file line number Diff line number Diff line change @@ -766,6 +766,21 @@ func UpdatePullRequest(ctx *context.Context) {
766766 ctx .Flash .Error (flashError )
767767 ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
768768 return
769+ } else if models .IsErrRebaseConflicts (err ) {
770+ conflictError := err .(models.ErrRebaseConflicts )
771+ flashError , err := ctx .HTMLString (string (tplAlertDetails ), map [string ]interface {}{
772+ "Message" : ctx .Tr ("repo.pulls.rebase_conflict" , utils .SanitizeFlashErrorString (conflictError .CommitSHA )),
773+ "Summary" : ctx .Tr ("repo.pulls.rebase_conflict_summary" ),
774+ "Details" : utils .SanitizeFlashErrorString (conflictError .StdErr ) + "<br>" + utils .SanitizeFlashErrorString (conflictError .StdOut ),
775+ })
776+ if err != nil {
777+ ctx .ServerError ("UpdatePullRequest.HTMLString" , err )
778+ return
779+ }
780+ ctx .Flash .Error (flashError )
781+ ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
782+ return
783+
769784 }
770785 ctx .Flash .Error (err .Error ())
771786 ctx .Redirect (ctx .Repo .RepoLink + "/pulls/" + fmt .Sprint (issue .Index ))
Original file line number Diff line number Diff line change 6262 {{end -}}
6363 {{- range .ReviewComments}}
6464 <hr>
65- {{.i18n.Tr "mail.issue.in_tree_path" .TreePath}}
65+ {{$ .i18n.Tr "mail.issue.in_tree_path" .TreePath}}
6666 <div class="review">
6767 <pre>{{.Patch}}</pre>
6868 <div>{{.RenderedContent | Safe}}</div>
You can’t perform that action at this time.
0 commit comments