From ad6011cb7a4e3b99b7bcfa277dc349bd51a21788 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Oct 2019 10:35:50 +0100 Subject: [PATCH] rename git.untrackedChanges: default to mixed --- extensions/git/package.json | 22 +++++++++++----------- extensions/git/package.nls.json | 2 +- extensions/git/src/commands.ts | 6 +++--- extensions/git/src/repository.ts | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index 8ec962fa04c..2a92f716712 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -907,42 +907,42 @@ }, { "command": "git.cleanAll", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed", "group": "1_modification" }, { "command": "git.stageAll", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed", "group": "1_modification" }, { "command": "git.cleanAll", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed", "group": "inline" }, { "command": "git.stageAll", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed", "group": "inline" }, { "command": "git.cleanAllTracked", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed", "group": "1_modification" }, { "command": "git.stageAllTracked", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed", "group": "1_modification" }, { "command": "git.cleanAllTracked", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed", "group": "inline" }, { "command": "git.stageAllTracked", - "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", + "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed", "group": "inline" }, { @@ -1601,16 +1601,16 @@ "git.untrackedChanges": { "type": "string", "enum": [ - "default", + "mixed", "separate", "hidden" ], "enumDescriptions": [ - "%config.untrackedChanges.default%", + "%config.untrackedChanges.mixed%", "%config.untrackedChanges.separate%", "%config.untrackedChanges.hidden%" ], - "default": "default", + "default": "mixed", "description": "%config.untrackedChanges%", "scope": "resource" } diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 48847a1e4df..0c4959e20e4 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -136,7 +136,7 @@ "config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.", "config.branchSortOrder": "Controls the sort order for branches.", "config.untrackedChanges": "Controls how untracked changes behave.", - "config.untrackedChanges.default": "All changes, tracked and untracked, appear together and behave equally.", + "config.untrackedChanges.mixed": "All changes, tracked and untracked, appear together and behave equally.", "config.untrackedChanges.separate": "Untracked changes appear separately in the Source Control view. They are also excluded from several actions.", "config.untrackedChanges.hidden": "Untracked changes are hidden and excluded from several actions.", "colors.added": "Color for added resources.", diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index a37723a0d5f..c019cd96d11 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -915,8 +915,8 @@ export class CommandCenter { } const config = workspace.getConfiguration('git', Uri.file(repository.root)); - const untrackedChanges = config.get<'default' | 'separate' | 'hidden'>('untrackedChanges'); - await repository.add([], untrackedChanges === 'default' ? undefined : { update: true }); + const untrackedChanges = config.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges'); + await repository.add([], untrackedChanges === 'mixed' ? undefined : { update: true }); } private async _stageDeletionConflict(repository: Repository, uri: Uri): Promise { @@ -1421,7 +1421,7 @@ export class CommandCenter { opts.all = 'tracked'; } - if (opts.all && config.get<'default' | 'separate' | 'hidden'>('untrackedChanges') !== 'default') { + if (opts.all && config.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges') !== 'mixed') { opts.all = 'tracked'; } diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index f40ca7489ef..949c97bb8a3 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -1509,7 +1509,7 @@ export class Repository implements Disposable { this._submodules = submodules!; this.rebaseCommit = rebaseCommit; - const untrackedChanges = scopedConfig.get<'default' | 'separate' | 'hidden'>('untrackedChanges'); + const untrackedChanges = scopedConfig.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges'); const index: Resource[] = []; const workingTree: Resource[] = []; const merge: Resource[] = []; @@ -1523,12 +1523,12 @@ export class Repository implements Disposable { switch (raw.x + raw.y) { case '??': switch (untrackedChanges) { - case 'default': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.UNTRACKED, useIcons)); + case 'mixed': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.UNTRACKED, useIcons)); case 'separate': return untracked.push(new Resource(ResourceGroupType.Untracked, uri, Status.UNTRACKED, useIcons)); default: return undefined; } case '!!': switch (untrackedChanges) { - case 'default': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.IGNORED, useIcons)); + case 'mixed': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.IGNORED, useIcons)); case 'separate': return untracked.push(new Resource(ResourceGroupType.Untracked, uri, Status.IGNORED, useIcons)); default: return undefined; } @@ -1575,7 +1575,7 @@ export class Repository implements Disposable { private setCountBadge(): void { const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); const countBadge = config.get<'all' | 'tracked' | 'off'>('countBadge'); - const untrackedChanges = config.get<'default' | 'separate' | 'hidden'>('untrackedChanges'); + const untrackedChanges = config.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges'); let count = this.mergeGroup.resourceStates.length + @@ -1585,7 +1585,7 @@ export class Repository implements Disposable { switch (countBadge) { case 'off': count = 0; break; case 'tracked': - if (untrackedChanges === 'default') { + if (untrackedChanges === 'mixed') { count -= this.workingTreeGroup.resourceStates.filter(r => r.type === Status.UNTRACKED || r.type === Status.IGNORED).length; } break; -- GitLab