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.
This commit is contained in:
parent
106ff20de7
commit
f226f30e6f
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user