mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-06 07:00:27 -05:00
command/format: take noop changes from lcs
When rendering the diff, the NoOp changes should come from the LCS sequence, rather than the new sequence. The two indexes will not align in many cases, adding the wrong new object or indexing out of bounds.
This commit is contained in:
@@ -1101,8 +1101,8 @@ func ctySequenceDiff(old, new []cty.Value) []*plans.Change {
|
||||
if lcsI < len(lcs) {
|
||||
ret = append(ret, &plans.Change{
|
||||
Action: plans.NoOp,
|
||||
Before: new[newI],
|
||||
After: new[newI],
|
||||
Before: lcs[lcsI],
|
||||
After: lcs[lcsI],
|
||||
})
|
||||
|
||||
// All of our indexes advance together now, since the line
|
||||
|
||||
Reference in New Issue
Block a user