From d2b9cab1dada3d46223b70f3c619f1dc0602e5a0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 13 Apr 2025 16:07:38 -0700 Subject: [PATCH] Fix bug --- services/context/repo.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/services/context/repo.go b/services/context/repo.go index acf829abee..64f929829f 100644 --- a/services/context/repo.go +++ b/services/context/repo.go @@ -920,11 +920,8 @@ func RepoRefByType(detectRefType git.RefType) func(*Context) { ctx.Data["RefFullName"] = ctx.Repo.RefFullName ctx.Data["RefTypeNameSubURL"] = ctx.Repo.RefTypeNameSubURL() ctx.Data["TreePath"] = ctx.Repo.TreePath - ctx.Data["BranchName"] = ctx.Repo.BranchName - ctx.Data["CommitID"] = ctx.Repo.CommitID - ctx.Data["CanCreateBranch"] = ctx.Repo.CanCreateBranch() // only used by the branch selector dropdown: AllowCreateNewRef // if it's a tag, we just get the commits count from database @@ -957,9 +954,9 @@ func RepoRefByType(detectRefType git.RefType) func(*Context) { ctx.ServerError("GetCommitsCount", err) return } - ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount - ctx.Repo.GitRepo.LastCommitCache = git.NewLastCommitCache(ctx.Repo.CommitsCount, ctx.Repo.Repository.FullName(), ctx.Repo.GitRepo, cache.GetCache()) } + ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount + ctx.Repo.GitRepo.LastCommitCache = git.NewLastCommitCache(ctx.Repo.CommitsCount, ctx.Repo.Repository.FullName(), ctx.Repo.GitRepo, cache.GetCache()) } }