mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2026-03-21 13:55:30 +00:00
Restart Init
This commit is contained in:
28
git/commit.go
Normal file
28
git/commit.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Commit struct {
|
||||
Repo *Repo
|
||||
Path string
|
||||
URL string
|
||||
Branch string
|
||||
Hash string
|
||||
Email string
|
||||
Name string
|
||||
Date time.Time
|
||||
}
|
||||
|
||||
func (g *Commit) ValidateCommit() error {
|
||||
if g.Hash == "" || g.Date.IsZero() {
|
||||
return InvalidStateError
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g Commit) String() string {
|
||||
return fmt.Sprintf("Path: %s\nURL: %s\nBranch: %s\nHash: %s\nDate: %s", g.Path, g.URL, g.Branch, g.Hash, g.Date)
|
||||
}
|
||||
Reference in New Issue
Block a user