aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/create.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-17 19:28:37 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-17 19:28:37 +0200
commit76ac1787b8de8698b878d1837c5fa8f6fe6403fc (patch)
tree2261d605eb533bc5f037887a983da0039281c9f5 /bug/operations/create.go
parent7b19b10e19e5dbbae79a47d3e4338b15b3e8d972 (diff)
downloadgit-bug-76ac1787b8de8698b878d1837c5fa8f6fe6403fc.tar.gz
add bug status + open/close commands
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r--bug/operations/create.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/bug/operations/create.go b/bug/operations/create.go
index f4ca11ad..ad1d99ac 100644
--- a/bug/operations/create.go
+++ b/bug/operations/create.go
@@ -2,7 +2,6 @@ package operations
import (
"github.com/MichaelMure/git-bug/bug"
- "reflect"
"time"
)
@@ -20,7 +19,7 @@ type CreateOperation struct {
func NewCreateOp(author bug.Person, title, message string) CreateOperation {
return CreateOperation{
- OpBase: bug.OpBase{OperationType: bug.CREATE},
+ OpBase: bug.OpBase{OperationType: bug.CreateOp},
Title: title,
Message: message,
Author: author,
@@ -29,12 +28,6 @@ func NewCreateOp(author bug.Person, title, message string) CreateOperation {
}
func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
- empty := bug.Snapshot{}
-
- if !reflect.DeepEqual(snapshot, empty) {
- panic("Create operation should never be applied on a non-empty snapshot")
- }
-
snapshot.Title = op.Title
snapshot.Comments = []bug.Comment{
{