diff --git a/src/commands/suggest.ts b/src/commands/suggest.ts index 85f3ac6..b3177a2 100644 --- a/src/commands/suggest.ts +++ b/src/commands/suggest.ts @@ -388,6 +388,10 @@ export async function suggestCommand( } if (shouldCommit) { + if (!diffResult.staged) { + outro(pc.red('Commit requires staged changes. Stage your changes with `git add` and try again.')); + return; + } await acceptAndCommit(selected, config, diffResult.diff); } else { console.log(`\n ${pc.green('Selected:')} ${pc.bold(selected.message)}`);