From a37b2786d9716df96d8957a2dbc8030cea5bc803 Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Mon, 1 Dec 2025 21:32:00 +0100 Subject: Associate commits with branch information and display branch in commit views --- commit.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'commit.go') 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, -- cgit v1.2.3