diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-18 00:16:06 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-18 00:16:06 +0200 |
commit | ba3281dc9918fa49f10c2a166b5b631a931d2d51 (patch) | |
tree | f6e9d17fa7828634f250c7af0674d5405ba0d224 /bug/operations/create.go | |
parent | 6f83d89274fc796e01149c84b91b8aa2066f0273 (diff) | |
download | git-bug-ba3281dc9918fa49f10c2a166b5b631a931d2d51.tar.gz |
all operations now have an author and a timestamp
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r-- | bug/operations/create.go | 13 |
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 |