mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Close stale diff editors while stashing changes
This commit is contained in:
parent
aed7eb754a
commit
888677ed95
|
@ -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.",
|
||||
|
|
|
@ -1636,7 +1636,15 @@ export class Repository implements Disposable {
|
|||
}
|
||||
|
||||
async createStash(message?: string, includeUntracked?: boolean): Promise<void> {
|
||||
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<void> {
|
||||
|
|
Loading…
Reference in a new issue