aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/set_title.go
blob: 0d935db6f174bbee39c236333884dd9aba1a4aa6 (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"

var _ Operation = SetTitleOperation{}

type SetTitleOperation struct {
	Title string
}

func NewSetTitleOp(title string) SetTitleOperation {
	return SetTitleOperation{
		Title: title,
	}
}

func (op SetTitleOperation) OpType() OperationType {
	return SET_TITLE
}

func (op SetTitleOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
	snapshot.Title = op.Title
	return snapshot
}