fix: Address review comments

This commit is contained in:
gsxdsm
2026-02-18 19:52:25 -08:00
parent 4ba0026aa1
commit 4ee160fae4
16 changed files with 184 additions and 35 deletions

View File

@@ -160,7 +160,18 @@ export async function performMerge(
// If squash merge, need to commit (using safe array-based command)
if (options?.squash) {
const squashMessage = options?.message || `Merge ${branchName} (squash)`;
await execGitCommand(['commit', '-m', squashMessage], projectPath);
try {
await execGitCommand(['commit', '-m', squashMessage], projectPath);
} catch (commitError: unknown) {
const err = commitError as { message?: string };
// Emit merge:error so subscribers always receive either merge:success or merge:error
emitter?.emit('merge:error', {
branchName,
targetBranch: mergeTo,
error: err.message || String(commitError),
});
throw commitError;
}
}
// Optionally delete the worktree and branch after merging