blob: d10dc6d6f7ba71395388b516847c1fd86e14d522 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package syw
import (
"strings"
"time"
)
type Commit struct {
Repo *Repository
Hash string
Parents []string
CommitterName string
CommitterEmail string
CommitDate time.Time
AuthorName string
AuthorEmail string
AuthorDate time.Time
Message string
}
func (c *Commit) ShortMessage() string {
short, _, _ := strings.Cut(c.Message, "\n")
return short
}
func (c *Commit) RestOfMessage() string {
_, rest, _ := strings.Cut(c.Message, "\n")
return strings.TrimPrefix(rest, "\n")
}
|