diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-14 11:38:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-14 11:38:04 +0800 |
commit | 2677d071f911fb91f382acfedaedc251bd807f70 (patch) | |
tree | 61d48125ff6e509e5ffe385b23fdc14fb454b9e6 /modules/convert/pull.go | |
parent | bca367cecc6004957a952bb6222b9bbdc868e784 (diff) | |
download | gitea-2677d071f911fb91f382acfedaedc251bd807f70.tar.gz gitea-2677d071f911fb91f382acfedaedc251bd807f70.zip |
Move newbranch to standalone package (#9627)
* Move newbranch to standalone package
* move branch functions to modules to avoid dependencies cycles
* fix tests
* fix lint
* fix lint
Diffstat (limited to 'modules/convert/pull.go')
-rw-r--r-- | modules/convert/pull.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/convert/pull.go b/modules/convert/pull.go index f8534f839a..18b4bc8de5 100644 --- a/modules/convert/pull.go +++ b/modules/convert/pull.go @@ -8,6 +8,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" + repo_module "code.gitea.io/gitea/modules/repository" api "code.gitea.io/gitea/modules/structs" ) @@ -69,7 +70,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest { Created: pr.Issue.CreatedUnix.AsTimePtr(), Updated: pr.Issue.UpdatedUnix.AsTimePtr(), } - baseBranch, err = pr.BaseRepo.GetBranch(pr.BaseBranch) + baseBranch, err = repo_module.GetBranch(pr.BaseRepo, pr.BaseBranch) if err != nil { if git.IsErrBranchNotExist(err) { apiPullRequest.Base = nil @@ -98,7 +99,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest { apiPullRequest.Base = apiBaseBranchInfo } - headBranch, err = pr.HeadRepo.GetBranch(pr.HeadBranch) + headBranch, err = repo_module.GetBranch(pr.HeadRepo, pr.HeadBranch) if err != nil { if git.IsErrBranchNotExist(err) { apiPullRequest.Head = nil |