aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operation_pack.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/operation_pack.go')
-rw-r--r--bug/operation_pack.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/bug/operation_pack.go b/bug/operation_pack.go
index 6a134b94..0bd3fb7d 100644
--- a/bug/operation_pack.go
+++ b/bug/operation_pack.go
@@ -9,7 +9,9 @@ import (
"github.com/MichaelMure/git-bug/repository"
)
-const formatVersion = 1
+// 1: original format
+// 2: no more legacy identities
+const formatVersion = 2
// OperationPack represent an ordered set of operation to apply
// to a Bug. These operations are stored in a single Git commit.
@@ -44,8 +46,11 @@ func (opp *OperationPack) UnmarshalJSON(data []byte) error {
return err
}
- if aux.Version != formatVersion {
- return fmt.Errorf("unknown format version %v", aux.Version)
+ if aux.Version < formatVersion {
+ return fmt.Errorf("outdated repository format, please use https://github.com/MichaelMure/git-bug-migration to upgrade")
+ }
+ if aux.Version > formatVersion {
+ return fmt.Errorf("your version of git-bug is too old for this repository (version %v), please upgrade to the latest version", aux.Version)
}
for _, raw := range aux.Operations {