|
|
@ -192,12 +192,18 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error |
|
|
|
return fmt.Errorf("git fetch [%s -> %s]: %s", headRepoPath, tmpBasePath, stderr) |
|
|
|
return fmt.Errorf("git fetch [%s -> %s]: %s", headRepoPath, tmpBasePath, stderr) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if _, stderr, err = process.ExecDir(-1, tmpBasePath, |
|
|
|
|
|
|
|
fmt.Sprintf("PullRequest.Merge (git merge --no-commit): %s", tmpBasePath), |
|
|
|
|
|
|
|
"git", "merge", "--no-commit", "head_repo/"+pr.HeadBranch); err != nil { |
|
|
|
|
|
|
|
return fmt.Errorf("git merge --no-commit [%s]: %s", tmpBasePath, stderr) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sig := doer.NewGitSig() |
|
|
|
if _, stderr, err = process.ExecDir(-1, tmpBasePath, |
|
|
|
if _, stderr, err = process.ExecDir(-1, tmpBasePath, |
|
|
|
fmt.Sprintf("PullRequest.Merge (git merge): %s", tmpBasePath), |
|
|
|
fmt.Sprintf("PullRequest.Merge (git merge): %s", tmpBasePath), |
|
|
|
"git", "merge", "--no-ff", "-m", |
|
|
|
"git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email), |
|
|
|
fmt.Sprintf("Merge branch '%s' of %s/%s into %s", pr.HeadBranch, pr.HeadUserName, pr.HeadRepo.Name, pr.BaseBranch), |
|
|
|
"-m", fmt.Sprintf("Merge branch '%s' of %s/%s into %s", pr.HeadBranch, pr.HeadUserName, pr.HeadRepo.Name, pr.BaseBranch)); err != nil { |
|
|
|
"head_repo/"+pr.HeadBranch); err != nil { |
|
|
|
return fmt.Errorf("git commit [%s]: %s", tmpBasePath, stderr) |
|
|
|
return fmt.Errorf("git merge[%s]: %s", tmpBasePath, stderr) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Push back to upstream.
|
|
|
|
// Push back to upstream.
|
|
|
|