From f226f30e6f71f445ae355d77f6f94598ec30793a Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 10 Apr 2026 08:58:45 -0700 Subject: [PATCH] Handle reset failure gracefully when squash produces no changes The reset during early exit could throw if the worktree is already in a conflicted state, masking the real "no changes" diagnostic. --- src/commands/squash.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/squash.ts b/src/commands/squash.ts index 0236081..764edf9 100644 --- a/src/commands/squash.ts +++ b/src/commands/squash.ts @@ -35,7 +35,7 @@ export async function action(branch: string) { const diff = await git.diffStaged(worktree) if (!diff.trim()) { - await git.resetSoft(originalHead, worktree) + await git.resetSoft(originalHead, worktree).catch(() => {}) spin.fail("No changes after squash") process.exit(1) }