()
| 22 | } |
| 23 | |
| 24 | func (c *Commit) GetCommitString() string { |
| 25 | output := "" |
| 26 | |
| 27 | output += fmt.Sprintf("Commit ID: %s\n", c.id) |
| 28 | output += fmt.Sprintf("Author: %s\n", c.author) |
| 29 | output += fmt.Sprintf("Author Date: %s\n", c.authorDate.String()) |
| 30 | output += fmt.Sprintf("Commit: %s\n", c.commit) |
| 31 | output += fmt.Sprintf("Commit Date: %s\n", c.commitDate.String()) |
| 32 | output += fmt.Sprintf("Comments: %s\n", c.comment) |
| 33 | output += fmt.Sprintln("Files:") |
| 34 | for _, f := range c.matchFiles { |
| 35 | output += fmt.Sprintf(" * %s\n", f.Path) |
| 36 | } |
| 37 | output += fmt.Sprintln() |
| 38 | |
| 39 | return output |
| 40 | } |
| 41 | |
| 42 | func (c *Commit) AuthorDate(line string) { |
| 43 | t, err := time.Parse("Mon Jan 2 15:04:05 2006 -0700", strings.TrimPrefix(line, "AuthorDate: ")) |
no outgoing calls
no test coverage detected