aboutsummaryrefslogtreecommitdiffstats
path: root/operations/create.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-12 16:57:04 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-12 16:57:46 +0200
commit60fcfcdcb0e89741528cfc99a94a48f204d48e6b (patch)
tree48189b7f85e10b1bdf6a4b897ac0b966c4cec23c /operations/create.go
parent3605887345792d2f981f971c6c4a2cb7f86a343e (diff)
downloadgit-bug-60fcfcdcb0e89741528cfc99a94a48f204d48e6b.tar.gz
bug: change the OperationPack serialization format for Json
See https://github.com/MichaelMure/git-bug/issues/5 for the details of this choice
Diffstat (limited to 'operations/create.go')
-rw-r--r--operations/create.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/operations/create.go b/operations/create.go
index 81e5af93..a671171e 100644
--- a/operations/create.go
+++ b/operations/create.go
@@ -11,9 +11,9 @@ var _ bug.Operation = CreateOperation{}
type CreateOperation struct {
bug.OpBase
- Title string
- Message string
- files []git.Hash
+ Title string `json:"title"`
+ Message string `json:"message"`
+ Files []git.Hash `json:"files"`
}
func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
@@ -30,8 +30,8 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
return snapshot
}
-func (op CreateOperation) Files() []git.Hash {
- return op.files
+func (op CreateOperation) GetFiles() []git.Hash {
+ return op.Files
}
func NewCreateOp(author bug.Person, title, message string, files []git.Hash) CreateOperation {
@@ -39,7 +39,7 @@ func NewCreateOp(author bug.Person, title, message string, files []git.Hash) Cre
OpBase: bug.NewOpBase(bug.CreateOp, author),
Title: title,
Message: message,
- files: files,
+ Files: files,
}
}