|
@@ -362,7 +362,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
mergeCommit, err := baseGitRepo.BranchCommit(pr.BaseBranch)
|
|
|
if err != nil {
|
|
|
log.Error("Failed to get base branch %q commit: %v", pr.BaseBranch, err)
|
|
@@ -395,7 +395,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
func (pr *PullRequest) testPatch() (err error) {
|
|
|
if pr.BaseRepo == nil {
|
|
@@ -410,9 +410,9 @@ func (pr *PullRequest) testPatch() (err error) {
|
|
|
return fmt.Errorf("BaseRepo.PatchPath: %v", err)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if !osutil.IsFile(patchPath) {
|
|
|
- log.Trace("PullRequest[%d].testPatch: ignored cruppted data", pr.ID)
|
|
|
+ log.Trace("PullRequest[%d].testPatch: ignored corrupted data", pr.ID)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
@@ -436,7 +436,7 @@ func (pr *PullRequest) testPatch() (err error) {
|
|
|
fmt.Sprintf("testPatch (git apply --check): %d", pr.BaseRepo.ID),
|
|
|
"git", args...)
|
|
|
if err != nil {
|
|
|
- log.Trace("PullRequest[%d].testPatch (apply): has conflit\n%s", pr.ID, stderr)
|
|
|
+ log.Trace("PullRequest[%d].testPatch (apply): has conflict\n%s", pr.ID, stderr)
|
|
|
pr.Status = PULL_REQUEST_STATUS_CONFLICT
|
|
|
return nil
|
|
|
}
|
|
@@ -515,7 +515,7 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
func GetUnmergedPullRequest(headRepoID, baseRepoID int64, headBranch, baseBranch string) (*PullRequest, error) {
|
|
|
pr := new(PullRequest)
|
|
@@ -536,7 +536,7 @@ func GetUnmergedPullRequest(headRepoID, baseRepoID int64, headBranch, baseBranch
|
|
|
return pr, nil
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequest, error) {
|
|
|
prs := make([]*PullRequest, 0, 2)
|
|
@@ -545,7 +545,7 @@ func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequ
|
|
|
Join("INNER", "issue", "issue.id = pull_request.issue_id").Find(&prs)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error) {
|
|
|
prs := make([]*PullRequest, 0, 2)
|
|
@@ -622,7 +622,7 @@ func (pr *PullRequest) UpdateCols(cols ...string) error {
|
|
|
|
|
|
func (pr *PullRequest) UpdatePatch() (err error) {
|
|
|
if pr.HeadRepo == nil {
|
|
|
- log.Trace("PullRequest[%d].UpdatePatch: ignored cruppted data", pr.ID)
|
|
|
+ log.Trace("PullRequest[%d].UpdatePatch: ignored corrupted data", pr.ID)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
@@ -829,7 +829,7 @@ func ChangeUsernameInPullRequests(oldUserName, newUserName string) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
func (pr *PullRequest) checkAndUpdateStatus() {
|
|
|
|
|
@@ -837,7 +837,7 @@ func (pr *PullRequest) checkAndUpdateStatus() {
|
|
|
pr.Status = PULL_REQUEST_STATUS_MERGEABLE
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if !PullRequestQueue.Exist(pr.ID) {
|
|
|
if err := pr.UpdateCols("status"); err != nil {
|
|
|
log.Error("Update[%d]: %v", pr.ID, err)
|