From 5b8cb25675530fc191e1d607c3047d9b822cd0e8 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 28 Nov 2025 16:40:34 +0000 Subject: [PATCH] Revert "Checkout branch with "force" so it updates the tree" This reverts commit d13bc84232ef838acb559ed1c2c985ee8aecd14e. proceed with caution on this as i dont know what you were fixing with this change --- src/components/GitDialog.tsx | 2 -- src/components/git/BranchManager.tsx | 1 - src/lib/commands/git/checkout.ts | 2 -- src/lib/git.ts | 1 - 4 files changed, 6 deletions(-) diff --git a/src/components/GitDialog.tsx b/src/components/GitDialog.tsx index d1714318..06adc4df 100644 --- a/src/components/GitDialog.tsx +++ b/src/components/GitDialog.tsx @@ -182,7 +182,6 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog await git.checkout({ dir: projectPath, ref: branchName, - force: true, }); toast({ @@ -1289,7 +1288,6 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog await git.checkout({ dir: projectPath, ref: pr.sourceBranch, - force: true, }); await refetchGitStatus(); toast({ diff --git a/src/components/git/BranchManager.tsx b/src/components/git/BranchManager.tsx index c36ec0b5..55d8362f 100644 --- a/src/components/git/BranchManager.tsx +++ b/src/components/git/BranchManager.tsx @@ -223,7 +223,6 @@ export function BranchManager({ projectId, currentBranch, onBranchChange }: Bran await git.checkout({ dir: projectPath, ref: branchName, - force: true, }); toast({ diff --git a/src/lib/commands/git/checkout.ts b/src/lib/commands/git/checkout.ts index 5a9ac187..d43fc801 100644 --- a/src/lib/commands/git/checkout.ts +++ b/src/lib/commands/git/checkout.ts @@ -122,7 +122,6 @@ export class GitCheckoutCommand implements GitSubcommand { await this.git.checkout({ dir: cwd, ref: branchName, - force: true, }); return createSuccessResult(`Switched to branch '${branchName}'\n`); @@ -165,7 +164,6 @@ export class GitCheckoutCommand implements GitSubcommand { await this.git.checkout({ dir: cwd, ref: branchName, - force: true, }); return createSuccessResult(`Switched to a new branch '${branchName}'\n`); diff --git a/src/lib/git.ts b/src/lib/git.ts index 842c3abd..2cbd9477 100644 --- a/src/lib/git.ts +++ b/src/lib/git.ts @@ -1244,7 +1244,6 @@ export class Git { fs: this.fs, dir: options.dir, ref: expectedBranch, - force: true, }); } catch (checkoutError) { console.warn(`Failed to checkout branch ${expectedBranch}:`, checkoutError);