diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-30 11:00:39 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-30 11:03:42 +0200 |
commit | 037f5bf50b2bb2b020620413d186b6acf47a0b61 (patch) | |
tree | 6639ac6f8c53bcc4a27660ea92faff46974e98b2 /bug/op_edit_comment.go | |
parent | d450c7a883876e0f5356fb5cb54109a0a2a77dfd (diff) | |
download | git-bug-037f5bf50b2bb2b020620413d186b6acf47a0b61.tar.gz |
timeline: various minor improvements
Diffstat (limited to 'bug/op_edit_comment.go')
-rw-r--r-- | bug/op_edit_comment.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bug/op_edit_comment.go b/bug/op_edit_comment.go index c6cfab2b..cb4a2216 100644 --- a/bug/op_edit_comment.go +++ b/bug/op_edit_comment.go @@ -57,18 +57,20 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) { return } + comment := Comment{ + Message: op.Message, + Files: op.Files, + UnixTime: Timestamp(op.UnixTime), + } + switch target.(type) { case *CreateTimelineItem: item := target.(*CreateTimelineItem) - newComment := item.LastState() - newComment.Message = op.Message - item.History = append(item.History, newComment) + item.Append(comment) case *CommentTimelineItem: item := target.(*CommentTimelineItem) - newComment := item.LastState() - newComment.Message = op.Message - item.History = append(item.History, newComment) + item.Append(comment) } snapshot.Comments[commentIndex].Message = op.Message |