diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-30 17:15:54 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-30 17:15:54 +0200 |
commit | 7f86898ef9a8f9e866835ece3c9824a8edc58036 (patch) | |
tree | 5c5733c9272f3477317935bde6ecb4680276b717 /bug/op_create.go | |
parent | d71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (diff) | |
download | git-bug-7f86898ef9a8f9e866835ece3c9824a8edc58036.tar.gz |
bug: use deditated type for all TimelineItem
Diffstat (limited to 'bug/op_create.go')
-rw-r--r-- | bug/op_create.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bug/op_create.go b/bug/op_create.go index 0553137f..200da4ae 100644 --- a/bug/op_create.go +++ b/bug/op_create.go @@ -47,7 +47,9 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) { } snapshot.Timeline = []TimelineItem{ - NewCreateTimelineItem(hash, comment), + &CreateTimelineItem{ + CommentTimelineItem: NewCommentTimelineItem(hash, comment), + }, } } @@ -88,6 +90,11 @@ func NewCreateOp(author Person, unixTime int64, title, message string, files []g } } +// CreateTimelineItem replace a Create operation in the Timeline and hold its edition history +type CreateTimelineItem struct { + CommentTimelineItem +} + // Convenience function to apply the operation func Create(author Person, unixTime int64, title, message string) (*Bug, error) { return CreateWithFiles(author, unixTime, title, message, nil) |