models/pull: better error message detection (#4265)
Stop using English phrases in case of Git localization.master
parent
89cc6aa430
commit
f860ddbbb7
|
@ -331,9 +331,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
|
||||||
|
|
||||||
// patchConflicts is a list of conflit description from Git.
|
// patchConflicts is a list of conflit description from Git.
|
||||||
var patchConflicts = []string{
|
var patchConflicts = []string{
|
||||||
"patch does not apply",
|
"fatal:",
|
||||||
"already exists in working directory",
|
|
||||||
"unrecognized input",
|
|
||||||
"error:",
|
"error:",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,8 +372,7 @@ func (pr *PullRequest) testPatch() (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
for i := range patchConflicts {
|
for i := range patchConflicts {
|
||||||
if strings.Contains(stderr, patchConflicts[i]) {
|
if strings.Contains(stderr, patchConflicts[i]) {
|
||||||
log.Trace("PullRequest[%d].testPatch (apply): has conflit", pr.ID)
|
log.Trace("PullRequest[%d].testPatch (apply): has conflit\n%s", pr.ID, stderr)
|
||||||
fmt.Println(stderr)
|
|
||||||
pr.Status = PULL_REQUEST_STATUS_CONFLICT
|
pr.Status = PULL_REQUEST_STATUS_CONFLICT
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue