2020-11-07 16:52:09 +00:00
|
|
|
package git
|
|
|
|
|
2021-04-15 04:28:04 +00:00
|
|
|
import (
|
|
|
|
"github.com/go-git/go-git/v5/plumbing/object"
|
|
|
|
)
|
2020-11-07 16:52:09 +00:00
|
|
|
|
2021-03-29 13:57:06 +00:00
|
|
|
// Commit stores all git-commit information
|
2020-11-07 16:52:09 +00:00
|
|
|
type Commit struct {
|
2021-04-15 04:28:04 +00:00
|
|
|
Author Author
|
2022-07-03 14:57:44 +00:00
|
|
|
Message string
|
2020-11-07 16:52:09 +00:00
|
|
|
}
|
|
|
|
|
2021-03-29 13:57:06 +00:00
|
|
|
// Convert from git-commit
|
2020-11-07 16:52:09 +00:00
|
|
|
func newCommit(commit *object.Commit) Commit {
|
|
|
|
return Commit{
|
|
|
|
Message: commit.Message,
|
2021-04-15 04:28:04 +00:00
|
|
|
Author: Author{
|
|
|
|
Name: commit.Author.Name,
|
|
|
|
Email: commit.Author.Email,
|
|
|
|
When: commit.Author.When,
|
|
|
|
},
|
2020-11-07 16:52:09 +00:00
|
|
|
}
|
|
|
|
}
|