aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/set_status.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/set_status.go
parent7b19b10e19e5dbbae79a47d3e4338b15b3e8d972 (diff)
downloadgit-bug-76ac1787b8de8698b878d1837c5fa8f6fe6403fc.tar.gz
add bug status + open/close commands
Diffstat (limited to 'bug/operations/set_status.go')
-rw-r--r--bug/operations/set_status.go24
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
+}