From 097d0e793c4bda8c00df9f96fcd9921873de78d3 Mon Sep 17 00:00:00 2001 From: aryanboii Date: Sun, 30 Aug 2026 02:31:15 +0530 Subject: [PATCH 1/2] fix: resolve commit suggestion issue --- src/commands/suggest.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/suggest.ts b/src/commands/suggest.ts index 85f3ac6..fa361f5 100644 --- a/src/commands/suggest.ts +++ b/src/commands/suggest.ts @@ -388,8 +388,12 @@ export async function suggestCommand( } if (shouldCommit) { - await acceptAndCommit(selected, config, diffResult.diff); - } else { + 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)}`); if (selected.body) { console.log(` ${pc.dim(selected.body)}`); From 73972ad7759dda33663e2cef5873ea82173bc89c Mon Sep 17 00:00:00 2001 From: 404-Page-Found <139850808+404-Page-Found@users.noreply.github.com> Date: Tue, 8 Sep 2026 09:25:52 +1000 Subject: [PATCH 2/2] Update src/commands/suggest.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- src/commands/suggest.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commands/suggest.ts b/src/commands/suggest.ts index fa361f5..b3177a2 100644 --- a/src/commands/suggest.ts +++ b/src/commands/suggest.ts @@ -388,12 +388,12 @@ 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 { + 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)}`); if (selected.body) { console.log(` ${pc.dim(selected.body)}`);