aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-09 13:04:41 -0500
committerUnknwon <u@gogs.io>2017-03-09 13:04:41 -0500
commitf860ddbbb729dbe4d074acdafb0dd9853ecfeafb (patch)
tree59dc9710548412c085e758f106ab8c37a64f7c4a
parent89cc6aa430c65b87808ee4a159e0a80785b51935 (diff)
models/pull: better error message detection (#4265)
Stop using English phrases in case of Git localization.
-rw-r--r--models/pull.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/models/pull.go b/models/pull.go
index 8e9e0c5d..054d2649 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -331,9 +331,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
// patchConflicts is a list of conflit description from Git.
var patchConflicts = []string{
- "patch does not apply",
- "already exists in working directory",
- "unrecognized input",
+ "fatal:",
"error:",
}
@@ -374,8 +372,7 @@ func (pr *PullRequest) testPatch() (err error) {
if err != nil {
for i := range patchConflicts {
if strings.Contains(stderr, patchConflicts[i]) {
- log.Trace("PullRequest[%d].testPatch (apply): has conflit", pr.ID)
- fmt.Println(stderr)
+ log.Trace("PullRequest[%d].testPatch (apply): has conflit\n%s", pr.ID, stderr)
pr.Status = PULL_REQUEST_STATUS_CONFLICT
return nil
}