Skip to content

Commit

Permalink
Allow empty maps for yaml (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedam committed Jul 24, 2021
1 parent 75cd389 commit 108b211
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions stores/yaml/store.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 108b211

Please sign in to comment.