From 34b7f9110a1e99bbbbfa20f44a50fac977cc5a9d Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Tue, 14 Oct 2025 15:51:22 -0500 Subject: [PATCH] Fix fast-forward merge error requiring http parameter The git.fastForward() function requires an http client for fetching from remote, which we don't need for local branch merges. Changed to use git.writeRef() to directly update the branch reference to point to the source branch commit, which is the correct way to do a local fast-forward merge without needing network operations. --- src/components/git/MergeDialog.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/git/MergeDialog.tsx b/src/components/git/MergeDialog.tsx index bb0dc623..1e8f9b18 100644 --- a/src/components/git/MergeDialog.tsx +++ b/src/components/git/MergeDialog.tsx @@ -220,11 +220,12 @@ export function MergeDialog({ }).catch(() => false); if (canFastForward) { - // Fast-forward merge: just update the current branch ref - await git.fastForward({ + // Fast-forward merge: update the current branch to point to source branch commit + await git.writeRef({ dir: projectPath, - ref: currentBranch, - singleBranch: true, + ref: `refs/heads/${currentBranch}`, + value: sourceOid, + force: true, }); // Update working directory to match the new HEAD