diff options
author | Unknwon <u@gogs.io> | 2017-03-09 13:36:40 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-09 13:36:40 -0500 |
commit | c3cde864f8b2ea0f87d2a10d78c4b4a3ee554906 (patch) | |
tree | 7816f7fb0079c4169b04a2aab69ae0bdd1c540d5 /models/pull.go | |
parent | f860ddbbb729dbe4d074acdafb0dd9853ecfeafb (diff) |
models/pull: treat all errors as conflict (#4265)
If there is a misdetection, log shows everything.
Diffstat (limited to 'models/pull.go')
-rw-r--r-- | models/pull.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/models/pull.go b/models/pull.go index 054d2649..d1c5078d 100644 --- a/models/pull.go +++ b/models/pull.go @@ -329,12 +329,6 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error return nil } -// patchConflicts is a list of conflit description from Git. -var patchConflicts = []string{ - "fatal:", - "error:", -} - // testPatch checks if patch can be merged to base repository without conflit. // FIXME: make a mechanism to clean up stable local copies. func (pr *PullRequest) testPatch() (err error) { @@ -370,15 +364,9 @@ func (pr *PullRequest) testPatch() (err error) { fmt.Sprintf("testPatch (git apply --check): %d", pr.BaseRepo.ID), "git", "apply", "--check", patchPath) if err != nil { - for i := range patchConflicts { - if strings.Contains(stderr, patchConflicts[i]) { - log.Trace("PullRequest[%d].testPatch (apply): has conflit\n%s", pr.ID, stderr) - pr.Status = PULL_REQUEST_STATUS_CONFLICT - return nil - } - } - - return fmt.Errorf("git apply --check: %v - %s", err, stderr) + log.Trace("PullRequest[%d].testPatch (apply): has conflit\n%s", pr.ID, stderr) + pr.Status = PULL_REQUEST_STATUS_CONFLICT + return nil } return nil } |