diff options
Diffstat (limited to 'bug/operations/set_status.go')
-rw-r--r-- | bug/operations/set_status.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bug/operations/set_status.go b/bug/operations/set_status.go new file mode 100644 index 00000000..aa673bb1 --- /dev/null +++ b/bug/operations/set_status.go @@ -0,0 +1,24 @@ +package operations + +import "github.com/MichaelMure/git-bug/bug" + +// SetStatusOperation will change the status of a bug + +var _ bug.Operation = SetStatusOperation{} + +type SetStatusOperation struct { + bug.OpBase + Status bug.Status +} + +func NewSetStatusOp(status bug.Status) SetStatusOperation { + return SetStatusOperation{ + OpBase: bug.OpBase{OperationType: bug.SetStatusOp}, + Status: status, + } +} + +func (op SetStatusOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { + snapshot.Status = op.Status + return snapshot +} |