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.
This commit is contained in:
shakespeare.diy committed 2025-10-14 15:51:22 -05:00
1 parent 97791ed21a
commit 34b7f9110a
1 file changed
+5 -4
+5 -4
View File
@@ -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