From 108b211cfb7e05c4973fbf04ee36a48539308e23 Mon Sep 17 00:00:00 2001 From: ikedam Date: Sat, 24 Jul 2021 15:20:07 +0900 Subject: [PATCH] Allow empty maps for yaml (#907) --- stores/yaml/store.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stores/yaml/store.go b/stores/yaml/store.go index d9e78b528..da9b946b2 100644 --- a/stores/yaml/store.go +++ b/stores/yaml/store.go @@ -361,11 +361,7 @@ func (store *Store) EmitPlainFile(branches sops.TreeBranches) ([]byte, error) { mapping.Kind = yaml.MappingNode // Marshal branch to global mapping node store.appendTreeBranch(branch, &mapping) - if len(mapping.Content) == 0 { - doc.HeadComment = mapping.HeadComment - } else { - doc.Content = append(doc.Content, &mapping) - } + doc.Content = append(doc.Content, &mapping) // Encode YAML err := e.Encode(&doc) if err != nil {