@@ -2054,6 +2054,11 @@ export class Repository implements Disposable {
2054
2054
2055
2055
private async _updateModelState ( optimisticResourcesGroups ?: GitResourceGroups , cancellationToken ?: CancellationToken ) : Promise < void > {
2056
2056
try {
2057
+ // Optimistically update resource groups
2058
+ if ( optimisticResourcesGroups ) {
2059
+ this . _updateResourceGroupsState ( optimisticResourcesGroups ) ;
2060
+ }
2061
+
2057
2062
const config = workspace . getConfiguration ( 'git' ) ;
2058
2063
let sort = config . get < 'alphabetically' | 'committerdate' > ( 'branchSortOrder' ) || 'alphabetically' ;
2059
2064
if ( sort !== 'alphabetically' && sort !== 'committerdate' ) {
@@ -2079,13 +2084,10 @@ export class Repository implements Disposable {
2079
2084
2080
2085
this . _sourceControl . commitTemplate = commitTemplate ;
2081
2086
2082
- // Optimistically update the resource states
2083
- if ( optimisticResourcesGroups ) {
2084
- this . _updateResourceGroupsState ( optimisticResourcesGroups ) ;
2085
- }
2086
-
2087
- // Update resource states based on status information
2087
+ // Update resource states based on status data
2088
2088
this . _updateResourceGroupsState ( await this . getStatus ( cancellationToken ) ) ;
2089
+
2090
+ this . _onDidChangeStatus . fire ( ) ;
2089
2091
}
2090
2092
catch ( err ) {
2091
2093
if ( err instanceof CancellationError ) {
@@ -2105,8 +2107,6 @@ export class Repository implements Disposable {
2105
2107
2106
2108
// set count badge
2107
2109
this . setCountBadge ( ) ;
2108
-
2109
- this . _onDidChangeStatus . fire ( ) ;
2110
2110
}
2111
2111
2112
2112
private async getStatus ( cancellationToken ?: CancellationToken ) : Promise < GitResourceGroups > {
0 commit comments