aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/create.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r--bug/operations/create.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/bug/operations/create.go b/bug/operations/create.go
index ad1d99ac..72eba843 100644
--- a/bug/operations/create.go
+++ b/bug/operations/create.go
@@ -2,7 +2,6 @@ package operations
import (
"github.com/MichaelMure/git-bug/bug"
- "time"
)
// CreateOperation define the initial creation of a bug
@@ -13,17 +12,13 @@ type CreateOperation struct {
bug.OpBase
Title string
Message string
- Author bug.Person
- Time int64
}
func NewCreateOp(author bug.Person, title, message string) CreateOperation {
return CreateOperation{
- OpBase: bug.OpBase{OperationType: bug.CreateOp},
+ OpBase: bug.NewOpBase(bug.CreateOp, author),
Title: title,
Message: message,
- Author: author,
- Time: time.Now().Unix(),
}
}
@@ -31,9 +26,9 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
snapshot.Title = op.Title
snapshot.Comments = []bug.Comment{
{
- Message: op.Message,
- Author: op.Author,
- Time: op.Time,
+ Message: op.Message,
+ Author: op.Author,
+ UnixTime: op.UnixTime,
},
}
return snapshot