aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_set_status.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/op_set_status.go')
-rw-r--r--bug/op_set_status.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/bug/op_set_status.go b/bug/op_set_status.go
index 1fb9cab6..cdfa25e7 100644
--- a/bug/op_set_status.go
+++ b/bug/op_set_status.go
@@ -5,28 +5,28 @@ import (
"github.com/pkg/errors"
)
-// SetStatusOperation will change the status of a bug
-
-var _ Operation = SetStatusOperation{}
+var _ Operation = &SetStatusOperation{}
+// SetStatusOperation will change the status of a bug
type SetStatusOperation struct {
*OpBase
Status Status `json:"status"`
}
-func (op SetStatusOperation) base() *OpBase {
+func (op *SetStatusOperation) base() *OpBase {
return op.OpBase
}
-func (op SetStatusOperation) Hash() (git.Hash, error) {
+func (op *SetStatusOperation) Hash() (git.Hash, error) {
return hashOperation(op)
}
-func (op SetStatusOperation) Apply(snapshot *Snapshot) {
+func (op *SetStatusOperation) Apply(snapshot *Snapshot) {
snapshot.Status = op.Status
+ snapshot.Timeline = append(snapshot.Timeline, op)
}
-func (op SetStatusOperation) Validate() error {
+func (op *SetStatusOperation) Validate() error {
if err := opBaseValidate(op, SetStatusOp); err != nil {
return err
}
@@ -38,8 +38,8 @@ func (op SetStatusOperation) Validate() error {
return nil
}
-func NewSetStatusOp(author Person, unixTime int64, status Status) SetStatusOperation {
- return SetStatusOperation{
+func NewSetStatusOp(author Person, unixTime int64, status Status) *SetStatusOperation {
+ return &SetStatusOperation{
OpBase: newOpBase(SetStatusOp, author, unixTime),
Status: status,
}