@@ -1265,7 +1265,8 @@ export class Repository implements Disposable {
12651265
12661266 await this . repository . rebaseContinue ( ) ;
12671267 await this . commitOperationCleanup ( message , opts ) ;
1268- } ) ;
1268+ } ,
1269+ ( ) => this . commitOperationGetOptimisticResourceGroups ( opts ) ) ;
12691270 } else {
12701271 // Set post-commit command to render the correct action button
12711272 this . commitCommandCenter . postCommitCommand = opts . postCommitCommand ;
@@ -1288,19 +1289,7 @@ export class Repository implements Disposable {
12881289 await this . repository . commit ( message , opts ) ;
12891290 await this . commitOperationCleanup ( message , opts ) ;
12901291 } ,
1291- ( ) : GitResourceGroups => {
1292- let untrackedGroup : Resource [ ] | undefined = undefined ,
1293- workingTreeGroup : Resource [ ] | undefined = undefined ;
1294-
1295- if ( opts . all === 'tracked' ) {
1296- workingTreeGroup = this . workingTreeGroup . resourceStates
1297- . filter ( r => r . type === Status . UNTRACKED ) ;
1298- } else if ( opts . all ) {
1299- untrackedGroup = workingTreeGroup = [ ] ;
1300- }
1301-
1302- return { indexGroup : [ ] , untrackedGroup, workingTreeGroup } ;
1303- } ) ;
1292+ ( ) => this . commitOperationGetOptimisticResourceGroups ( opts ) ) ;
13041293
13051294 // Execute post-commit command
13061295 await this . run ( Operation . PostCommitCommand , async ( ) => {
@@ -1321,6 +1310,20 @@ export class Repository implements Disposable {
13211310 this . closeDiffEditors ( indexResources , workingGroupResources ) ;
13221311 }
13231312
1313+ private commitOperationGetOptimisticResourceGroups ( opts : CommitOptions ) : GitResourceGroups {
1314+ let untrackedGroup : Resource [ ] | undefined = undefined ,
1315+ workingTreeGroup : Resource [ ] | undefined = undefined ;
1316+
1317+ if ( opts . all === 'tracked' ) {
1318+ workingTreeGroup = this . workingTreeGroup . resourceStates
1319+ . filter ( r => r . type === Status . UNTRACKED ) ;
1320+ } else if ( opts . all ) {
1321+ untrackedGroup = workingTreeGroup = [ ] ;
1322+ }
1323+
1324+ return { indexGroup : [ ] , mergeGroup : [ ] , untrackedGroup, workingTreeGroup } ;
1325+ }
1326+
13241327 async clean ( resources : Uri [ ] ) : Promise < void > {
13251328 await this . run ( Operation . Clean , async ( ) => {
13261329 const toClean : string [ ] = [ ] ;
0 commit comments