Author | Jakob Wakeling <[email protected]> |
Date | 2023-12-24 09:42:16 |
Commit | d0367aad8e31d8c388f418ef898228986d84d2d8 |
Parent | 70fd6ec3e76cb05bd54c9f923ed115f95cfc3cdc |
Fix index out of bounds on certain commit messages
Diffstat
M | src/repo/commit.go | | | 4 | +--- |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/repo/commit.go b/src/repo/commit.go index 919d8f9..6b353aa 100644 --- a/src/repo/commit.go +++ b/src/repo/commit.go @@ -97,9 +97,7 @@ func HandleCommit(w http.ResponseWriter, r *http.Request) { data.Parents = append(data.Parents, h.String()) } - message := strings.SplitN(commit.Message, "\n", 2) - data.MessageSubject = message[0] - data.MessageBody = message[1] + data.MessageSubject, data.MessageBody, _ = strings.Cut(commit.Message, "\n") st, err := goit.DiffStats(commit) if err != nil {