fix: address branching strategy review findings

This commit is contained in:
Tom Boucher
2026-05-14 19:44:01 -04:00
parent 0f7b018d4d
commit 75dffc8069
3 changed files with 85 additions and 8 deletions

View File

@@ -348,6 +348,14 @@ function loadConfig(cwd, options = {}) {
const raw = platformReadSync(rootConfigPath);
if (raw === null) throw new Error('missing');
rootParsed = JSON.parse(raw);
if (Object.prototype.hasOwnProperty.call(rootParsed, 'branching_strategy')) {
if (!rootParsed.git) rootParsed.git = {};
if (rootParsed.git.branching_strategy === undefined) {
rootParsed.git.branching_strategy = rootParsed.branching_strategy;
}
delete rootParsed.branching_strategy;
try { platformWriteSync(rootConfigPath, JSON.stringify(rootParsed, null, 2)); } catch {}
}
} catch {
// Root config missing or unparseable — workstream config stands alone
}
@@ -407,7 +415,7 @@ function loadConfig(cwd, options = {}) {
// The nested value wins if already set (matches SDK mergeDefaults precedence, PR #3116).
if (Object.prototype.hasOwnProperty.call(fileData, 'branching_strategy')) {
if (!fileData.git) fileData.git = {};
if (!fileData.git.branching_strategy) {
if (fileData.git.branching_strategy === undefined) {
fileData.git.branching_strategy = fileData.branching_strategy;
}
delete fileData.branching_strategy;