all repos

mugit @ 6e88b48c21e672351799572fe3a7b74cebe7178e

🐮 git server that your cow will love
1 files changed, 11 insertions(+), 7 deletions(-)
ui: fix the multi line commit indicator
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-01-28 18:40:04 +0200
Change ID: kwurpnoypmzvmvyvsxvxyqrnsslrmsns
Parent: d1a0743
M internal/handlers/handlers.go

@@ -1,7 +1,6 @@

package handlers import ( - "fmt" "html/template" "net/http" "path/filepath"

@@ -49,12 +48,17 @@ }

var templateFuncs = template.FuncMap{ "humanizeTime": func(t time.Time) string { return humanize.Time(t) }, - "commitSummary": func(v any) string { - s := fmt.Sprint(v) - if i := strings.IndexByte(s, '\n'); i >= 0 { - s = strings.TrimSuffix(s[:i], "\r") - return s + "..." + "commitSummary": func(s string) string { + before, after, found := strings.Cut(s, "\n") + first := strings.TrimSuffix(before, "\r") + if !found { + return first + } + + if strings.Contains(after, "\n") { + return first + "..." } - return strings.TrimSuffix(s, "\r") + + return first }, }