promptgraph-mcp 2.0.7 → 2.0.8
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/github-import.js +7 -1
- package/package.json +1 -1
package/github-import.js
CHANGED
|
@@ -58,7 +58,13 @@ export async function importFromGitHub(repoUrl) {
|
|
|
58
58
|
if (fs.existsSync(dest)) {
|
|
59
59
|
console.log(`Updating ${repoName}...`);
|
|
60
60
|
const pullResult = spawnSync('git', ['-C', dest, 'pull', '--depth=1'], { stdio: 'inherit' });
|
|
61
|
-
if (pullResult.status !== 0)
|
|
61
|
+
if (pullResult.status !== 0) {
|
|
62
|
+
// Force-push or unrelated histories — re-clone from scratch
|
|
63
|
+
console.log(`Pull failed (force-push?), re-cloning ${repoName}...`);
|
|
64
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
65
|
+
const cloneResult = spawnSync('git', ['clone', '--depth=1', url, dest], { stdio: 'inherit' });
|
|
66
|
+
if (cloneResult.status !== 0) throw new Error(`git clone failed for ${url}`);
|
|
67
|
+
}
|
|
62
68
|
} else {
|
|
63
69
|
console.log(`Cloning ${url}...`);
|
|
64
70
|
const cloneResult = spawnSync('git', ['clone', '--depth=1', url, dest], { stdio: 'inherit' });
|