From 22d926fed60d0646c759dc3805321af8347df8d9 Mon Sep 17 00:00:00 2001 From: Dmitry Kabardinov Date: Fri, 6 Oct 2017 14:27:01 +0300 Subject: [PATCH] Git - show there are no changes to stash message only if there are neither staged nor unsataged files (#35645) --- extensions/git/src/commands.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index fc66825d924..334c008f953 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1283,7 +1283,9 @@ export class CommandCenter { @command('git.stash', { repository: true }) async stash(repository: Repository): Promise { - if (repository.workingTreeGroup.resourceStates.length === 0) { + const noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0; + const noStagedChanges = repository.indexGroup.resourceStates.length === 0; + if (noUnstagedChanges && noStagedChanges) { window.showInformationMessage(localize('no changes stash', "There are no changes to stash.")); return; }