summaryrefslogtreecommitdiff
path: root/commit.go
diff options
context:
space:
mode:
authorAnton Medvedev <anton@medv.io>2025-12-01 21:32:00 +0100
committerAnton Medvedev <anton@medv.io>2025-12-01 21:32:00 +0100
commita37b2786d9716df96d8957a2dbc8030cea5bc803 (patch)
tree7da7d08c0151dd18cd048dfefb19eac2ac49a5bf /commit.go
parent236d6df1b8df4b0ee84bd2a589597fd7d64874a9 (diff)
Associate commits with branch information and display branch in commit views
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,