yq/pkg
vomba 2a99e55756
fix: preserve correct parent references in explode merge anchor reconstruction
When explode resolves merge anchors (<<:), items copied from the
alias target retained the original parent pointer instead of being
set to the enclosing node being reconstructed. This caused GetPath()
to return wrong paths for children of merge-anchored nodes, making
subsequent merge operations target the wrong LHS keys.

In fixedReconstructAliasedMap, set copied.Parent = node after copy.

In reconstructAliasedMap (non-spec path), replace AddChild (which
creates sequence-style numeric-index entries) with AddKeyValueChild
to properly reconstruct mapping key-value pairs. AddKeyValueChild
also correctly sets parent references via SetParent.
2026-06-17 10:57:37 +02:00
..
yqlib fix: preserve correct parent references in explode merge anchor reconstruction 2026-06-17 10:57:37 +02:00