summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/commit.go')
-rw-r--r--routers/web/repo/commit.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go
index 06cce92417..c9e2b94f23 100644
--- a/routers/web/repo/commit.go
+++ b/routers/web/repo/commit.go
@@ -77,7 +77,7 @@ func Commits(ctx *context.Context) {
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
ctx.Data["CommitCount"] = commitsCount
- ctx.Data["Branch"] = ctx.Repo.BranchName
+ ctx.Data["RefName"] = ctx.Repo.RefName
pager := context.NewPagination(int(commitsCount), setting.Git.CommitsRangeSize, page, 5)
pager.SetDefaultParams(ctx)
@@ -153,7 +153,7 @@ func Graph(ctx *context.Context) {
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
ctx.Data["CommitCount"] = commitsCount
- ctx.Data["Branch"] = ctx.Repo.BranchName
+ ctx.Data["RefName"] = ctx.Repo.RefName
paginator := context.NewPagination(int(graphCommitsCount), setting.UI.GraphMaxCommitNum, page, 5)
paginator.AddParam(ctx, "mode", "Mode")
paginator.AddParam(ctx, "hide-pr-refs", "HidePRRefs")
@@ -199,7 +199,7 @@ func SearchCommits(ctx *context.Context) {
}
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
- ctx.Data["Branch"] = ctx.Repo.BranchName
+ ctx.Data["RefName"] = ctx.Repo.RefName
ctx.HTML(http.StatusOK, tplCommits)
}
@@ -213,8 +213,7 @@ func FileHistory(ctx *context.Context) {
return
}
- branchName := ctx.Repo.BranchName
- commitsCount, err := ctx.Repo.GitRepo.FileCommitsCount(branchName, fileName)
+ commitsCount, err := ctx.Repo.GitRepo.FileCommitsCount(ctx.Repo.RefName, fileName)
if err != nil {
ctx.ServerError("FileCommitsCount", err)
return
@@ -228,7 +227,7 @@ func FileHistory(ctx *context.Context) {
page = 1
}
- commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange(branchName, fileName, page)
+ commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange(ctx.Repo.RefName, fileName, page)
if err != nil {
ctx.ServerError("CommitsByFileAndRange", err)
return
@@ -239,7 +238,7 @@ func FileHistory(ctx *context.Context) {
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
ctx.Data["FileName"] = fileName
ctx.Data["CommitCount"] = commitsCount
- ctx.Data["Branch"] = branchName
+ ctx.Data["RefName"] = ctx.Repo.RefName
pager := context.NewPagination(int(commitsCount), setting.Git.CommitsRangeSize, page, 5)
pager.SetDefaultParams(ctx)