aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_create.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-30 17:15:54 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-30 17:15:54 +0200
commit7f86898ef9a8f9e866835ece3c9824a8edc58036 (patch)
tree5c5733c9272f3477317935bde6ecb4680276b717 /bug/op_create.go
parentd71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (diff)
downloadgit-bug-7f86898ef9a8f9e866835ece3c9824a8edc58036.tar.gz
bug: use deditated type for all TimelineItem
Diffstat (limited to 'bug/op_create.go')
-rw-r--r--bug/op_create.go9
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)