aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/set_status.go
blob: aa673bb14da04ed85d18209644438be99f6d1de5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
}