bmad-method 6.7.1-next.10 → 6.7.1-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -428,7 +428,27 @@ class CustomModuleManager {
|
|
|
428
428
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
429
429
|
});
|
|
430
430
|
} else {
|
|
431
|
-
|
|
431
|
+
// Resolve the default branch (origin/HEAD) and fetch it explicitly.
|
|
432
|
+
// With shallow clones, `origin/HEAD` is stale and `git reset --hard
|
|
433
|
+
// origin/HEAD` never picks up new commits on the default branch.
|
|
434
|
+
let defaultBranch = 'main';
|
|
435
|
+
try {
|
|
436
|
+
defaultBranch = execSync('git symbolic-ref refs/remotes/origin/HEAD --short', {
|
|
437
|
+
cwd: repoCacheDir,
|
|
438
|
+
stdio: 'pipe',
|
|
439
|
+
})
|
|
440
|
+
.toString()
|
|
441
|
+
.trim()
|
|
442
|
+
.replace('origin/', '');
|
|
443
|
+
} catch {
|
|
444
|
+
// Fallback if origin/HEAD is not set
|
|
445
|
+
}
|
|
446
|
+
execSync(`git fetch --depth 1 origin ${quoteCustomRef(defaultBranch)}`, {
|
|
447
|
+
cwd: repoCacheDir,
|
|
448
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
449
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
450
|
+
});
|
|
451
|
+
execSync(`git reset --hard origin/${quoteCustomRef(defaultBranch)}`, {
|
|
432
452
|
cwd: repoCacheDir,
|
|
433
453
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
434
454
|
});
|