aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_add_comment.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_add_comment.go
parentd71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (diff)
downloadgit-bug-7f86898ef9a8f9e866835ece3c9824a8edc58036.tar.gz
bug: use deditated type for all TimelineItem
Diffstat (limited to 'bug/op_add_comment.go')
-rw-r--r--bug/op_add_comment.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/bug/op_add_comment.go b/bug/op_add_comment.go
index 7f8b8b5b..156a8f71 100644
--- a/bug/op_add_comment.go
+++ b/bug/op_add_comment.go
@@ -42,7 +42,11 @@ func (op *AddCommentOperation) Apply(snapshot *Snapshot) {
panic(err)
}
- snapshot.Timeline = append(snapshot.Timeline, NewCommentTimelineItem(hash, comment))
+ item := &AddCommentTimelineItem{
+ CommentTimelineItem: NewCommentTimelineItem(hash, comment),
+ }
+
+ snapshot.Timeline = append(snapshot.Timeline, item)
}
func (op *AddCommentOperation) GetFiles() []git.Hash {
@@ -73,6 +77,11 @@ func NewAddCommentOp(author Person, unixTime int64, message string, files []git.
}
}
+// CreateTimelineItem replace a AddComment operation in the Timeline and hold its edition history
+type AddCommentTimelineItem struct {
+ CommentTimelineItem
+}
+
// Convenience function to apply the operation
func AddComment(b Interface, author Person, unixTime int64, message string) error {
return AddCommentWithFiles(b, author, unixTime, message, nil)