diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-24 15:56:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 15:56:24 +0800 |
commit | c97d66d23cf14e88514cccb88c393d21db51ab7a (patch) | |
tree | 625857bea77befb61847c01bf17aac1177255787 /routers/web/repo/branch.go | |
parent | 754fdd8f9c2b1e4e78d507fd414968334cf586fd (diff) | |
download | gitea-c97d66d23cf14e88514cccb88c393d21db51ab7a.tar.gz gitea-c97d66d23cf14e88514cccb88c393d21db51ab7a.zip |
Move repofiles from modules/repofiles to services/repository/files (#17774)
* Move repofiles from modules to services
* rename services/repository/repofiles -> services/repository/files
* Fix test
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/web/repo/branch.go')
-rw-r--r-- | routers/web/repo/branch.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/repo/branch.go b/routers/web/repo/branch.go index a6ad3eff5a..64fb1afb2d 100644 --- a/routers/web/repo/branch.go +++ b/routers/web/repo/branch.go @@ -17,7 +17,6 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/repofiles" repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" @@ -26,6 +25,7 @@ import ( "code.gitea.io/gitea/services/forms" release_service "code.gitea.io/gitea/services/release" repo_service "code.gitea.io/gitea/services/repository" + files_service "code.gitea.io/gitea/services/repository/files" ) const ( @@ -165,7 +165,7 @@ func redirect(ctx *context.Context) { // loadBranches loads branches from the repository limited by page & pageSize. // NOTE: May write to context on error. func loadBranches(ctx *context.Context, skip, limit int) ([]*Branch, int) { - defaultBranch, err := repo_module.GetBranch(ctx.Repo.Repository, ctx.Repo.Repository.DefaultBranch) + defaultBranch, err := repo_service.GetBranch(ctx.Repo.Repository, ctx.Repo.Repository.DefaultBranch) if err != nil { log.Error("loadBranches: get default branch: %v", err) ctx.ServerError("GetDefaultBranch", err) @@ -242,7 +242,7 @@ func loadOneBranch(ctx *context.Context, rawBranch *git.Branch, protectedBranche } } - divergence, divergenceError := repofiles.CountDivergingCommits(ctx.Repo.Repository, git.BranchPrefix+branchName) + divergence, divergenceError := files_service.CountDivergingCommits(ctx.Repo.Repository, git.BranchPrefix+branchName) if divergenceError != nil { ctx.ServerError("CountDivergingCommits", divergenceError) return nil |