Skip to content

Commit d2b9cab

Browse files
committed
Fix bug
1 parent ba0e7be commit d2b9cab

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

services/context/repo.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -920,11 +920,8 @@ func RepoRefByType(detectRefType git.RefType) func(*Context) {
920920
ctx.Data["RefFullName"] = ctx.Repo.RefFullName
921921
ctx.Data["RefTypeNameSubURL"] = ctx.Repo.RefTypeNameSubURL()
922922
ctx.Data["TreePath"] = ctx.Repo.TreePath
923-
924923
ctx.Data["BranchName"] = ctx.Repo.BranchName
925-
926924
ctx.Data["CommitID"] = ctx.Repo.CommitID
927-
928925
ctx.Data["CanCreateBranch"] = ctx.Repo.CanCreateBranch() // only used by the branch selector dropdown: AllowCreateNewRef
929926

930927
// if it's a tag, we just get the commits count from database
@@ -957,9 +954,9 @@ func RepoRefByType(detectRefType git.RefType) func(*Context) {
957954
ctx.ServerError("GetCommitsCount", err)
958955
return
959956
}
960-
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
961-
ctx.Repo.GitRepo.LastCommitCache = git.NewLastCommitCache(ctx.Repo.CommitsCount, ctx.Repo.Repository.FullName(), ctx.Repo.GitRepo, cache.GetCache())
962957
}
958+
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
959+
ctx.Repo.GitRepo.LastCommitCache = git.NewLastCommitCache(ctx.Repo.CommitsCount, ctx.Repo.Repository.FullName(), ctx.Repo.GitRepo, cache.GetCache())
963960
}
964961
}
965962

0 commit comments

Comments
 (0)