PR: process with ProjectGit originating from non-local
This commit is contained in:
@@ -267,6 +267,12 @@ func (pr *PRProcessor) UpdatePrjGitPR(prset *common.PRSet) error {
|
|||||||
git := pr.git
|
git := pr.git
|
||||||
PrjGit := PrjGitPR.PR.Base.Repo
|
PrjGit := PrjGitPR.PR.Base.Repo
|
||||||
prjGitPRbranch := PrjGitPR.PR.Head.Name
|
prjGitPRbranch := PrjGitPR.PR.Head.Name
|
||||||
|
if strings.Contains(prjGitPRbranch, "/") {
|
||||||
|
PrjGitPR.RemoteName, err = git.GitClone(common.DefaultGitPrj, "", PrjGit.SSHURL)
|
||||||
|
git.GitExecOrPanic(common.DefaultGitPrj, "fetch", PrjGitPR.RemoteName, PrjGitPR.PR.Head.Sha)
|
||||||
|
common.LogInfo("Cannot update this PR as it's on another remote, not branch:", prjGitPRbranch, "Assuming this is by-design. (eg. project git PR only)")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
PrjGitPR.RemoteName, err = git.GitClone(common.DefaultGitPrj, prjGitPRbranch, PrjGit.SSHURL)
|
PrjGitPR.RemoteName, err = git.GitClone(common.DefaultGitPrj, prjGitPRbranch, PrjGit.SSHURL)
|
||||||
common.PanicOnError(err)
|
common.PanicOnError(err)
|
||||||
@@ -428,7 +434,7 @@ func (pr *PRProcessor) Process(req *models.PullRequest) error {
|
|||||||
org, repo, branch := config.GetPrjGit()
|
org, repo, branch := config.GetPrjGit()
|
||||||
if pr, err := prset.GetPrjGitPR(); err == nil {
|
if pr, err := prset.GetPrjGitPR(); err == nil {
|
||||||
common.LogDebug("Submodule parse begin")
|
common.LogDebug("Submodule parse begin")
|
||||||
orig_subs, err := git.GitSubmoduleList(common.DefaultGitPrj, pr.RemoteName+"/"+branch) // merge base must remote branch, checked in prjgit udate
|
orig_subs, err := git.GitSubmoduleList(common.DefaultGitPrj, pr.PR.MergeBase)
|
||||||
common.PanicOnError(err)
|
common.PanicOnError(err)
|
||||||
new_subs, err := git.GitSubmoduleList(common.DefaultGitPrj, pr.PR.Head.Sha)
|
new_subs, err := git.GitSubmoduleList(common.DefaultGitPrj, pr.PR.Head.Sha)
|
||||||
common.PanicOnError(err)
|
common.PanicOnError(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user