File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1414
1515- Fixes unstaging files doesn't work in the Inspect/Details views ([ #4485 ] ( https://github.com/gitkraken/vscode-gitlens/issues/4485 ) )
1616- Fixes error when stashing only staged changes ([ #4490 ] ( https://github.com/gitkraken/vscode-gitlens/issues/4490 ) )
17+ - Fixes AI stash message generation when all changes are staged
1718
1819## [ 17.3.0] - 2025-07-08
1920
Original file line number Diff line number Diff line change @@ -642,11 +642,21 @@ export class StashGitCommand extends QuickCommand<State> {
642642 using resume = step . freeze ?.( ) ;
643643
644644 try {
645- const diff = await state . repo . git . diff . getDiff ?.(
645+ let diff = await state . repo . git . diff . getDiff ?.(
646646 state . flags . includes ( '--staged' ) ? uncommittedStaged : uncommitted ,
647647 undefined ,
648648 state . uris ?. length ? { uris : state . uris } : undefined ,
649649 ) ;
650+
651+ // If we didn't find a diff, check if everything is staged (e.g. diff to uncommittedStaged)
652+ if ( ! diff ?. contents && ! state . flags . includes ( '--staged' ) ) {
653+ diff = await state . repo . git . diff . getDiff ?.(
654+ uncommittedStaged ,
655+ undefined ,
656+ state . uris ?. length ? { uris : state . uris } : undefined ,
657+ ) ;
658+ }
659+
650660 if ( ! diff ?. contents ) {
651661 void window . showInformationMessage ( 'No changes to generate a stash message from.' ) ;
652662 return ;
You can’t perform that action at this time.
0 commit comments