TestResetCommandFlagsRestoresEveryFlag read its expected values from the live flag variables. The root pre-run fills some of those from config without marking the flag Changed (doltAutoCommit, main.go:1224), so when an in-process command ran earlier in the binary the baseline for --dolt-auto-commit was "on", and the reset under test correctly put it back to "". PR Core (wrapper timing) has failed on that assertion on every fork PR since #7185. The test now calls resetCommandFlags before taking its baseline. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
a93498c81f
commit
4524f4a428
1 changed files with 7 additions and 0 deletions
|
|
@ -200,6 +200,13 @@ func TestResetCommandFlagsRestoresEveryFlag(t *testing.T) {
|
|||
// shared command tree.
|
||||
t.Cleanup(func() { resetCommandFlags(rootCmd) })
|
||||
|
||||
// Start from the registered baseline, not from whatever an earlier
|
||||
// in-process command left behind: the root pre-run fills flag variables
|
||||
// such as doltAutoCommit from config without marking them Changed, and a
|
||||
// baseline read from that live value is one a reset correctly does not
|
||||
// restore (gastownhall/beads#7190).
|
||||
resetCommandFlags(rootCmd)
|
||||
|
||||
type state struct {
|
||||
value string
|
||||
changed bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue