From 283e97111b0b39a4e8f7717234f0bfbbb4f481af Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 27 Aug 2019 12:11:51 +0200 Subject: bug: make sure there is no Operation's hash collision --- bug/op_set_metadata.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bug/op_set_metadata.go') diff --git a/bug/op_set_metadata.go b/bug/op_set_metadata.go index f99f836b..67f7e009 100644 --- a/bug/op_set_metadata.go +++ b/bug/op_set_metadata.go @@ -34,6 +34,8 @@ func (op *SetMetadataOperation) Apply(snapshot *Snapshot) { base.extraMetadata = make(map[string]string) } + // Apply the metadata in an immutable way: if a metadata already + // exist, it's not possible to override it. for key, val := range op.NewMetadata { if _, exist := base.extraMetadata[key]; !exist { base.extraMetadata[key] = val -- cgit