summaryrefslogtreecommitdiff
path: root/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/commit.go b/commit.go
index 2091592..571c8e2 100644
--- a/commit.go
+++ b/commit.go
@@ -229,13 +229,18 @@ func generateCommitPage(commit git.Commit, params Params) error {
return filesViews[i].Path < filesViews[j].Path
})
+ currentRef := params.DefaultRef
+ if commit.Branch != "" {
+ currentRef = commit.Branch
+ }
+
err = templates.CommitTemplate.ExecuteTemplate(f, "layout.gohtml", templates.CommitParams{
LayoutParams: templates.LayoutParams{
Title: fmt.Sprintf("%s %s %s@%s", commit.Subject, dot, params.Name, commit.ShortHash),
Name: params.Name,
Dark: params.Dark,
RootHref: rootHref,
- CurrentRef: params.Ref,
+ CurrentRef: currentRef,
Selected: "commits",
},
Commit: commit,