diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index f86b0549f9a..c6123b9afc3 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -1265,7 +1265,8 @@ export class Repository implements Disposable { await this.repository.rebaseContinue(); await this.commitOperationCleanup(message, opts); - }); + }, + () => this.commitOperationGetOptimisticResourceGroups(opts)); } else { // Set post-commit command to render the correct action button this.commitCommandCenter.postCommitCommand = opts.postCommitCommand; @@ -1288,19 +1289,7 @@ export class Repository implements Disposable { await this.repository.commit(message, opts); await this.commitOperationCleanup(message, opts); }, - (): GitResourceGroups => { - let untrackedGroup: Resource[] | undefined = undefined, - workingTreeGroup: Resource[] | undefined = undefined; - - if (opts.all === 'tracked') { - workingTreeGroup = this.workingTreeGroup.resourceStates - .filter(r => r.type === Status.UNTRACKED); - } else if (opts.all) { - untrackedGroup = workingTreeGroup = []; - } - - return { indexGroup: [], untrackedGroup, workingTreeGroup }; - }); + () => this.commitOperationGetOptimisticResourceGroups(opts)); // Execute post-commit command await this.run(Operation.PostCommitCommand, async () => { @@ -1321,6 +1310,20 @@ export class Repository implements Disposable { this.closeDiffEditors(indexResources, workingGroupResources); } + private commitOperationGetOptimisticResourceGroups(opts: CommitOptions): GitResourceGroups { + let untrackedGroup: Resource[] | undefined = undefined, + workingTreeGroup: Resource[] | undefined = undefined; + + if (opts.all === 'tracked') { + workingTreeGroup = this.workingTreeGroup.resourceStates + .filter(r => r.type === Status.UNTRACKED); + } else if (opts.all) { + untrackedGroup = workingTreeGroup = []; + } + + return { indexGroup: [], mergeGroup: [], untrackedGroup, workingTreeGroup }; + } + async clean(resources: Uri[]): Promise { await this.run(Operation.Clean, async () => { const toClean: string[] = [];