diff options
author | Michael Muré <batolettre@gmail.com> | 2020-07-01 20:00:53 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-10-04 20:50:15 +0200 |
commit | 499dbc0a032ff28eea99e5308be9b6c8f2d208ad (patch) | |
tree | 0ebfbc122240736292338275a5b599abaa7d710b /bug/operation_pack.go | |
parent | 5d1fc3ff393133a8aa67b97f9beecfe9b57c7e56 (diff) | |
download | git-bug-499dbc0a032ff28eea99e5308be9b6c8f2d208ad.tar.gz |
identity: remove support for legacy identity
Diffstat (limited to 'bug/operation_pack.go')
-rw-r--r-- | bug/operation_pack.go | 11 |
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 { |