aboutsummaryrefslogtreecommitdiffstats
path: root/services/pull/merge.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-02-22 13:08:48 +0000
committerGitHub <noreply@github.com>2020-02-22 15:08:48 +0200
commit089ccb0c80050efc8c3afef2402ea4f4a5ed250e (patch)
tree4ff172035ffd0a9a5263dedc051a91ab24c33fa6 /services/pull/merge.go
parent2ed9ead6dea29f9e006fa1831892c9c239f4bd70 (diff)
downloadgitea-089ccb0c80050efc8c3afef2402ea4f4a5ed250e.tar.gz
gitea-089ccb0c80050efc8c3afef2402ea4f4a5ed250e.zip
Handle push rejection message in Merge & Web Editor (#10373)
* Handle push rejection message in Merge * placate golangci-lint * Fix sanitize, adjust message handling * oops * Oops * Handle push-rejection in webeditor CRUD too * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'services/pull/merge.go')
-rw-r--r--services/pull/merge.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 8f3e183551..4d02d7193d 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -392,6 +392,15 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge
StdErr: errbuf.String(),
Err: err,
}
+ } else if strings.Contains(errbuf.String(), "! [remote rejected]") {
+ err := models.ErrPushRejected{
+ Style: mergeStyle,
+ StdOut: outbuf.String(),
+ StdErr: errbuf.String(),
+ Err: err,
+ }
+ err.GenerateMessage()
+ return "", err
}
return "", fmt.Errorf("git push: %s", errbuf.String())
}