Skip to content

Commit

Permalink
Pushed some fixes based on testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru committed Feb 8, 2022
1 parent bf5d24d commit 40c325a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/git/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,9 @@ export class Repository implements Disposable {
async revert(resources: Uri[]): Promise<void> {
await this.run(Operation.RevertFiles, async () => {
await this.repository.revert('HEAD', resources.map(r => r.fsPath));
this.closeDiffEditors(resources.map(r => r.fsPath), []);
this.closeDiffEditors([...resources.length !== 0 ?
resources.map(r => r.fsPath) :
this.indexGroup.resourceStates.map(r => r.resourceUri.fsPath)], []);
});
}

Expand Down Expand Up @@ -1266,7 +1268,7 @@ export class Repository implements Disposable {

private closeDiffEditors(indexResources: string[], workingTreeResources: string[]): void {
const config = workspace.getConfiguration('git', Uri.file(this.root));
if (!config.get<boolean>('closeDiffOnCommitOrDiscard', false)) { return; }
if (!config.get<boolean>('closeDiffOnOperation', false)) { return; }

const diffEditorTabsToClose: Tab[] = [];

Expand Down

0 comments on commit 40c325a

Please sign in to comment.