aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_set_metadata.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-19 20:03:57 +0100
committerGitHub <noreply@github.com>2019-11-19 20:03:57 +0100
commit62fea2615d2bb870721b745a5dbe017772f20918 (patch)
treeebddc8a7919e95231b50b1d37f2f9acc324cd6d8 /bug/op_set_metadata.go
parente01cefff9826589b77bd34464301f196112d68f7 (diff)
parent283e97111b0b39a4e8f7717234f0bfbbb4f481af (diff)
downloadgit-bug-62fea2615d2bb870721b745a5dbe017772f20918.tar.gz
Merge pull request #213 from MichaelMure/hash-collision
bug: make sure there is no Operation's hash collision
Diffstat (limited to 'bug/op_set_metadata.go')
-rw-r--r--bug/op_set_metadata.go2
1 files changed, 2 insertions, 0 deletions
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