don't leave old refreshed state in the context

After apply, any refreshed state from a plan would be invalid. Normal
usage doesn't ever see this, bu internal tests may re-use the context.
This commit is contained in:
James Bardin 2020-09-11 17:27:12 -04:00
parent e54949f2e1
commit 19d67b7606
1 changed files with 4 additions and 0 deletions

View File

@ -492,6 +492,10 @@ Note that the -target option is not suitable for routine use, and is provided on
))
}
// This isn't technically needed, but don't leave an old refreshed state
// around in case we re-use the context in internal tests.
c.refreshState = c.state.DeepCopy()
return c.state, diags
}