aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.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 /bug/bug.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 'bug/bug.go')
-rw-r--r--bug/bug.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/bug/bug.go b/bug/bug.go
index ac078866..e548757e 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -1,6 +1,7 @@
package bug
import (
+ "encoding/json"
"errors"
"fmt"
"strings"
@@ -193,20 +194,21 @@ func readBug(repo repository.Repo, ref string) (*Bug, error) {
return nil, err
}
- op, err := ParseOperationPack(data)
+ opp := &OperationPack{}
+ err = json.Unmarshal(data, &opp)
if err != nil {
return nil, err
}
// tag the pack with the commit hash
- op.commitHash = hash
+ opp.commitHash = hash
if err != nil {
return nil, err
}
- bug.packs = append(bug.packs, *op)
+ bug.packs = append(bug.packs, *opp)
}
return &bug, nil
@@ -450,7 +452,7 @@ func makeMediaTree(pack OperationPack) []repository.TreeEntry {
added := make(map[git.Hash]interface{})
for _, ops := range pack.Operations {
- for _, file := range ops.Files() {
+ for _, file := range ops.GetFiles() {
if _, has := added[file]; !has {
tree = append(tree, repository.TreeEntry{
ObjectType: repository.Blob,