提交 ad6011cb 编写于 作者: J Joao Moreno

rename git.untrackedChanges: default to mixed

上级 363647b2
...@@ -907,42 +907,42 @@ ...@@ -907,42 +907,42 @@
}, },
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed",
"group": "1_modification" "group": "1_modification"
}, },
{ {
"command": "git.stageAll", "command": "git.stageAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed",
"group": "1_modification" "group": "1_modification"
}, },
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed",
"group": "inline" "group": "inline"
}, },
{ {
"command": "git.stageAll", "command": "git.stageAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == mixed",
"group": "inline" "group": "inline"
}, },
{ {
"command": "git.cleanAllTracked", "command": "git.cleanAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed",
"group": "1_modification" "group": "1_modification"
}, },
{ {
"command": "git.stageAllTracked", "command": "git.stageAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed",
"group": "1_modification" "group": "1_modification"
}, },
{ {
"command": "git.cleanAllTracked", "command": "git.cleanAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed",
"group": "inline" "group": "inline"
}, },
{ {
"command": "git.stageAllTracked", "command": "git.stageAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default", "when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != mixed",
"group": "inline" "group": "inline"
}, },
{ {
...@@ -1601,16 +1601,16 @@ ...@@ -1601,16 +1601,16 @@
"git.untrackedChanges": { "git.untrackedChanges": {
"type": "string", "type": "string",
"enum": [ "enum": [
"default", "mixed",
"separate", "separate",
"hidden" "hidden"
], ],
"enumDescriptions": [ "enumDescriptions": [
"%config.untrackedChanges.default%", "%config.untrackedChanges.mixed%",
"%config.untrackedChanges.separate%", "%config.untrackedChanges.separate%",
"%config.untrackedChanges.hidden%" "%config.untrackedChanges.hidden%"
], ],
"default": "default", "default": "mixed",
"description": "%config.untrackedChanges%", "description": "%config.untrackedChanges%",
"scope": "resource" "scope": "resource"
} }
......
...@@ -136,7 +136,7 @@ ...@@ -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.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.branchSortOrder": "Controls the sort order for branches.",
"config.untrackedChanges": "Controls how untracked changes behave.", "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.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.", "config.untrackedChanges.hidden": "Untracked changes are hidden and excluded from several actions.",
"colors.added": "Color for added resources.", "colors.added": "Color for added resources.",
......
...@@ -915,8 +915,8 @@ export class CommandCenter { ...@@ -915,8 +915,8 @@ export class CommandCenter {
} }
const config = workspace.getConfiguration('git', Uri.file(repository.root)); const config = workspace.getConfiguration('git', Uri.file(repository.root));
const untrackedChanges = config.get<'default' | 'separate' | 'hidden'>('untrackedChanges'); const untrackedChanges = config.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges');
await repository.add([], untrackedChanges === 'default' ? undefined : { update: true }); await repository.add([], untrackedChanges === 'mixed' ? undefined : { update: true });
} }
private async _stageDeletionConflict(repository: Repository, uri: Uri): Promise<void> { private async _stageDeletionConflict(repository: Repository, uri: Uri): Promise<void> {
...@@ -1421,7 +1421,7 @@ export class CommandCenter { ...@@ -1421,7 +1421,7 @@ export class CommandCenter {
opts.all = 'tracked'; 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'; opts.all = 'tracked';
} }
......
...@@ -1509,7 +1509,7 @@ export class Repository implements Disposable { ...@@ -1509,7 +1509,7 @@ export class Repository implements Disposable {
this._submodules = submodules!; this._submodules = submodules!;
this.rebaseCommit = rebaseCommit; this.rebaseCommit = rebaseCommit;
const untrackedChanges = scopedConfig.get<'default' | 'separate' | 'hidden'>('untrackedChanges'); const untrackedChanges = scopedConfig.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges');
const index: Resource[] = []; const index: Resource[] = [];
const workingTree: Resource[] = []; const workingTree: Resource[] = [];
const merge: Resource[] = []; const merge: Resource[] = [];
...@@ -1523,12 +1523,12 @@ export class Repository implements Disposable { ...@@ -1523,12 +1523,12 @@ export class Repository implements Disposable {
switch (raw.x + raw.y) { switch (raw.x + raw.y) {
case '??': switch (untrackedChanges) { 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)); case 'separate': return untracked.push(new Resource(ResourceGroupType.Untracked, uri, Status.UNTRACKED, useIcons));
default: return undefined; default: return undefined;
} }
case '!!': switch (untrackedChanges) { 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)); case 'separate': return untracked.push(new Resource(ResourceGroupType.Untracked, uri, Status.IGNORED, useIcons));
default: return undefined; default: return undefined;
} }
...@@ -1575,7 +1575,7 @@ export class Repository implements Disposable { ...@@ -1575,7 +1575,7 @@ export class Repository implements Disposable {
private setCountBadge(): void { private setCountBadge(): void {
const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
const countBadge = config.get<'all' | 'tracked' | 'off'>('countBadge'); 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 = let count =
this.mergeGroup.resourceStates.length + this.mergeGroup.resourceStates.length +
...@@ -1585,7 +1585,7 @@ export class Repository implements Disposable { ...@@ -1585,7 +1585,7 @@ export class Repository implements Disposable {
switch (countBadge) { switch (countBadge) {
case 'off': count = 0; break; case 'off': count = 0; break;
case 'tracked': case 'tracked':
if (untrackedChanges === 'default') { if (untrackedChanges === 'mixed') {
count -= this.workingTreeGroup.resourceStates.filter(r => r.type === Status.UNTRACKED || r.type === Status.IGNORED).length; count -= this.workingTreeGroup.resourceStates.filter(r => r.type === Status.UNTRACKED || r.type === Status.IGNORED).length;
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册