Skip to content

Commit 06626df

Browse files
shreyas-lyzrclaude
andcommitted
fix: --refresh now re-clones instead of git pull
git pull fails on shallow clones with divergent branches. Now --refresh deletes the cached clone and does a fresh clone instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 13e2117 commit 06626df

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shreyaskapale/gitagent",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "A framework-agnostic, git-native standard for defining AI agents",
55
"type": "module",
66
"bin": {

src/utils/git-cache.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export function resolveRepo(url: string, options: ResolveRepoOptions = {}): Reso
4343
}
4444

4545
if (existsSync(dir) && options.refresh) {
46-
execSync('git pull --depth 1', { cwd: dir, stdio: 'pipe' });
46+
// Nuke cached clone and re-clone fresh to avoid divergent branch issues
47+
rmSync(dir, { recursive: true, force: true });
48+
cloneRepo(url, branch, dir);
4749
return { dir };
4850
}
4951

0 commit comments

Comments
 (0)