diff options
Diffstat (limited to 'bug/op_create.go')
-rw-r--r-- | bug/op_create.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bug/op_create.go b/bug/op_create.go index 42d40f71..d5852db9 100644 --- a/bug/op_create.go +++ b/bug/op_create.go @@ -30,9 +30,17 @@ func (op *CreateOperation) Hash() (git.Hash, error) { } func (op *CreateOperation) Apply(snapshot *Snapshot) { + hash, err := op.Hash() + if err != nil { + // Should never error unless a programming error happened + // (covered in OpBase.Validate()) + panic(err) + } + snapshot.Title = op.Title comment := Comment{ + id: string(hash), Message: op.Message, Author: op.Author, UnixTime: timestamp.Timestamp(op.UnixTime), @@ -42,13 +50,6 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) { snapshot.Author = op.Author snapshot.CreatedAt = op.Time() - hash, err := op.Hash() - if err != nil { - // Should never error unless a programming error happened - // (covered in OpBase.Validate()) - panic(err) - } - snapshot.Timeline = []TimelineItem{ &CreateTimelineItem{ CommentTimelineItem: NewCommentTimelineItem(hash, comment), |