diff options
author | Michael Muré <batolettre@gmail.com> | 2019-08-07 15:31:38 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-08-08 19:02:46 +0200 |
commit | 2e1a5e246ee3589c2f664a62ebd06be7dc69c229 (patch) | |
tree | 03e69d6991fb4b9f9a159ba2d7b74b5f36d5069d /bug/timeline.go | |
parent | 2c3034a0abe13eb6b07d8dd13041e7be4adc6f93 (diff) | |
download | git-bug-2e1a5e246ee3589c2f664a62ebd06be7dc69c229.tar.gz |
bug: compute op's ID based on the serialized data on disk
Diffstat (limited to 'bug/timeline.go')
-rw-r--r-- | bug/timeline.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bug/timeline.go b/bug/timeline.go index d8ee2c6b..247c2927 100644 --- a/bug/timeline.go +++ b/bug/timeline.go @@ -9,8 +9,8 @@ import ( ) type TimelineItem interface { - // Hash return the hash of the item - Hash() git.Hash + // ID return the identifier of the item + ID() string } // CommentHistoryStep hold one version of a message in the history @@ -25,7 +25,7 @@ type CommentHistoryStep struct { // CommentTimelineItem is a TimelineItem that holds a Comment and its edition history type CommentTimelineItem struct { - hash git.Hash + id string Author identity.Interface Message string Files []git.Hash @@ -34,9 +34,9 @@ type CommentTimelineItem struct { History []CommentHistoryStep } -func NewCommentTimelineItem(hash git.Hash, comment Comment) CommentTimelineItem { +func NewCommentTimelineItem(ID string, comment Comment) CommentTimelineItem { return CommentTimelineItem{ - hash: hash, + id: ID, Author: comment.Author, Message: comment.Message, Files: comment.Files, @@ -51,8 +51,8 @@ func NewCommentTimelineItem(hash git.Hash, comment Comment) CommentTimelineItem } } -func (c *CommentTimelineItem) Hash() git.Hash { - return c.hash +func (c *CommentTimelineItem) ID() string { + return c.id } // Append will append a new comment in the history and update the other values |