fix(setup): resolve settings scope for bare disable and merged hook-install reads

main

Commit

suhaanthayyil2mo ago

Two follow-on gaps from the #1140 enable/disable scope-resolution fixes:

  • runDisable passed the raw, un-resolved useProjectSettings flag straight into setEnabledFlag, so a bare entire disable always wrote to settings.local.json (creating it if missing) instead of flipping whichever file already held the state. On a repo with only a committed settings.json, this silently diverged the checked-in file (still enabled:true) from the merged view. Now routes through the same settingsTargetFile resolution runEnableOnConfiguredRepo already uses.

  • setupAgentHooksNonInteractive builds its settings struct via settings.LoadFromFile(targetFileAbs), scoped to a single file, which is correct for the write path (avoids leaking the other scope's fields, per #1140) but was also used for local_dev/absolute_git_hook_path when installing/regenerating the git hook script. An override set only in the other scope's file was silently dropped from the hook's cmd prefix. Hook-install decisions now read the merged view (LoadEntireSettings), matching runEnableInteractive; the write path stays scoped.