Skip to content

Commit a8b09d4

Browse files
committed
fixed scope
1 parent 94389f7 commit a8b09d4

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

extensions/git/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,8 @@
12521252
"%config.countBadge.off%"
12531253
],
12541254
"description": "%config.countBadge%",
1255-
"default": "all"
1255+
"default": "all",
1256+
"scope": "resource"
12561257
},
12571258
"git.checkoutType": {
12581259
"type": "string",
@@ -1526,7 +1527,8 @@
15261527
"%config.handleUntracked.hide%"
15271528
],
15281529
"default": "withchanges",
1529-
"description": "%config.handleUntracked%"
1530+
"description": "%config.handleUntracked%",
1531+
"scope": "resource"
15301532
}
15311533
}
15321534
},

extensions/git/src/commands.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -914,12 +914,8 @@ export class CommandCenter {
914914
}
915915
}
916916

917-
const handleUntracked =
918-
workspace
919-
.getConfiguration('git', Uri.file(repository.root))
920-
.get<'withchanges' | 'separate' | 'hide'>('handleUntracked') ||
921-
'withchanges';
922-
let includeUntracked;
917+
const handleUntracked = workspace.getConfiguration('git', Uri.file(repository.root)).get<'withchanges' | 'separate' | 'hide'>('handleUntracked');
918+
let includeUntracked = false;
923919
switch (handleUntracked) {
924920
case 'withchanges':
925921
includeUntracked = true;

extensions/git/src/repository.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ export class Repository implements Disposable {
14471447
private async updateModelState(): Promise<void> {
14481448
const { status, didHitLimit } = await this.repository.getStatus();
14491449
const config = workspace.getConfiguration('git');
1450+
const scopedConfig = workspace.getConfiguration('git', Uri.file(this.repository.root));
14501451
const shouldIgnore = config.get<boolean>('ignoreLimitWarning') === true;
14511452
const useIcons = !config.get<boolean>('decorations.enabled', true);
14521453
this.isRepositoryHuge = didHitLimit;
@@ -1507,9 +1508,7 @@ export class Repository implements Disposable {
15071508
this._submodules = submodules!;
15081509
this.rebaseCommit = rebaseCommit;
15091510

1510-
const handleUntracked =
1511-
config.get<'withchanges' | 'separate' | 'hide'>('handleUntracked') ||
1512-
'withchanges';
1511+
const handleUntracked = scopedConfig.get<'withchanges' | 'separate' | 'hide'>('handleUntracked');
15131512
const index: Resource[] = [];
15141513
const workingTree: Resource[] = [];
15151514
const merge: Resource[] = [];
@@ -1586,11 +1585,10 @@ export class Repository implements Disposable {
15861585
}
15871586

15881587
private setCountBadge(): void {
1589-
const config = workspace.getConfiguration('git');
1590-
const countBadge = config.get<string>('countBadge');
1591-
const handleUntracked =
1592-
config.get<'withchanges' | 'separate' | 'hide'>('handleUntracked') ||
1593-
'withchanges';
1588+
const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
1589+
const countBadge = config.get<'all' | 'tracked' | 'off'>('countBadge');
1590+
const handleUntracked = config.get<'withchanges' | 'separate' | 'hide'>('handleUntracked');
1591+
15941592
let count =
15951593
this.mergeGroup.resourceStates.length +
15961594
this.indexGroup.resourceStates.length +

0 commit comments

Comments
 (0)