diff options
| author | Anton Medvedev <anton@medv.io> | 2025-12-01 21:32:00 +0100 |
|---|---|---|
| committer | Anton Medvedev <anton@medv.io> | 2025-12-01 21:32:00 +0100 |
| commit | a37b2786d9716df96d8957a2dbc8030cea5bc803 (patch) | |
| tree | 7da7d08c0151dd18cd048dfefb19eac2ac49a5bf /commit.go | |
| parent | 236d6df1b8df4b0ee84bd2a589597fd7d64874a9 (diff) | |
Associate commits with branch information and display branch in commit views
Diffstat (limited to 'commit.go')
| -rw-r--r-- | commit.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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, |
