diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index c3a9840b356..eef005ec4c3 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -175,7 +175,7 @@ "config.confirmForcePush": "Controls whether to ask for confirmation before force-pushing.", "config.allowNoVerifyCommit": "Controls whether commits without running pre-commit and commit-msg hooks are allowed.", "config.confirmNoVerifyCommit": "Controls whether to ask for confirmation before committing without verification.", - "config.closeDiffOnOperation": "Controls whether the diff editor should be automatically closed when changes are committed, discarded, staged, or unstaged.", + "config.closeDiffOnOperation": "Controls whether the diff editor should be automatically closed when changes are stashed, committed, discarded, staged, or unstaged.", "config.openDiffOnClick": "Controls whether the diff editor should be opened when clicking a change. Otherwise the regular editor will be opened.", "config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.", "config.branchSortOrder": "Controls the sort order for branches.", diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 0c6619ef45e..cc5432a27a6 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -1636,7 +1636,15 @@ export class Repository implements Disposable { } async createStash(message?: string, includeUntracked?: boolean): Promise { - return await this.run(Operation.Stash, () => this.repository.createStash(message, includeUntracked)); + const indexResources = [...this.indexGroup.resourceStates.map(r => r.resourceUri.fsPath)]; + const workingGroupResources = [ + ...this.workingTreeGroup.resourceStates.map(r => r.resourceUri.fsPath), + ...includeUntracked ? this.untrackedGroup.resourceStates.map(r => r.resourceUri.fsPath) : []]; + + return await this.run(Operation.Stash, async () => { + this.repository.createStash(message, includeUntracked); + this.closeDiffEditors(indexResources, workingGroupResources); + }); } async popStash(index?: number): Promise {