Browse Source

Merge pull request #322 from lunny/lunny/pull_typo

typo in model/pull.go
tags/v1.0.0
Kim "BKC" Carlbäcker 7 years ago
parent
commit
31950cb262
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      models/pull.go

+ 3
- 3
models/pull.go View File

return nil return nil
} }


// patchConflicts is a list of conflit description from Git.
// patchConflicts is a list of conflict description from Git.
var patchConflicts = []string{ var patchConflicts = []string{
"patch does not apply", "patch does not apply",
"already exists in working directory", "already exists in working directory",
"error:", "error:",
} }


// testPatch checks if patch can be merged to base repository without conflit.
// testPatch checks if patch can be merged to base repository without conflict.
// FIXME: make a mechanism to clean up stable local copies. // FIXME: make a mechanism to clean up stable local copies.
func (pr *PullRequest) testPatch() (err error) { func (pr *PullRequest) testPatch() (err error) {
if pr.BaseRepo == nil { if pr.BaseRepo == nil {
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 conflict", pr.ID)
fmt.Println(stderr) fmt.Println(stderr)
pr.Status = PullRequestStatusConflict pr.Status = PullRequestStatusConflict
return nil return nil

Loading…
Cancel
Save