Skip to content

Commit 6a06fb7

Browse files
authored
rename untrackedChangesEnableTrash to discardUntrackedChangesToTrash (microsoft#242186)
1 parent bd4ab86 commit 6a06fb7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

extensions/git/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3323,10 +3323,10 @@
33233323
"markdownDescription": "%config.diagnosticsCommitHook.Sources%",
33243324
"scope": "resource"
33253325
},
3326-
"git.untrackedChangesEnableTrash": {
3326+
"git.discardUntrackedChangesToTrash": {
33273327
"type": "boolean",
33283328
"default": true,
3329-
"markdownDescription": "%config.untrackedChangesEnableTrash%"
3329+
"markdownDescription": "%config.discardUntrackedChangesToTrash%"
33303330
}
33313331
}
33323332
},

extensions/git/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
"config.commitShortHashLength": "Controls the length of the commit short hash.",
289289
"config.diagnosticsCommitHook.Enabled": "Controls whether to check for unresolved diagnostics before committing.",
290290
"config.diagnosticsCommitHook.Sources": "Controls the list of sources (**Item**) and the minimum severity (**Value**) to be considered before committing. **Note:** To ignore diagnostics from a particular source, add the source to the list and set the minimum severity to `none`.",
291-
"config.untrackedChangesEnableTrash": "Controls whether discarding untracked changes moves the file(s) to the Recycle Bin (Windows), Trash (macOS, Linux) instead of deleting them permanently. **Note:** This setting has no effect when connected to a remote.",
291+
"config.discardUntrackedChangesToTrash": "Controls whether discarding untracked changes moves the file(s) to the Recycle Bin (Windows), Trash (macOS, Linux) instead of deleting them permanently. **Note:** This setting has no effect when connected to a remote.",
292292
"submenu.explorer": "Git",
293293
"submenu.commit": "Commit",
294294
"submenu.commit.amend": "Amend",

extensions/git/src/commands.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,9 +2175,9 @@ export class CommandCenter {
21752175

21762176
private getDiscardUntrackedChangesDialogDetails(resources: Resource[]): [string, string, string] {
21772177
const config = workspace.getConfiguration('git');
2178-
const untrackedChangesEnableTrash = config.get<boolean>('untrackedChangesEnableTrash', true) && !isRemote;
2178+
const discardUntrackedChangesToTrash = config.get<boolean>('discardUntrackedChangesToTrash', true) && !isRemote;
21792179

2180-
const messageWarning = !untrackedChangesEnableTrash
2180+
const messageWarning = !discardUntrackedChangesToTrash
21812181
? resources.length === 1
21822182
? '\n\nThis is IRREVERSIBLE!\nThis file will be FOREVER LOST if you proceed.'
21832183
: '\n\nThis is IRREVERSIBLE!\nThese files will be FOREVER LOST if you proceed.'
@@ -2187,7 +2187,7 @@ export class CommandCenter {
21872187
? l10n.t('Are you sure you want to DELETE the following untracked file: \'{0}\'?{1}', path.basename(resources[0].resourceUri.fsPath), messageWarning)
21882188
: l10n.t('Are you sure you want to DELETE the {0} untracked files?{1}', resources.length, messageWarning);
21892189

2190-
const messageDetail = untrackedChangesEnableTrash
2190+
const messageDetail = discardUntrackedChangesToTrash
21912191
? isWindows
21922192
? resources.length === 1
21932193
? 'You can restore this file from the Recycle Bin.'
@@ -2197,7 +2197,7 @@ export class CommandCenter {
21972197
: 'You can restore these files from the Trash.'
21982198
: '';
21992199

2200-
const primaryAction = untrackedChangesEnableTrash
2200+
const primaryAction = discardUntrackedChangesToTrash
22012201
? isWindows
22022202
? l10n.t('Move to Recycle Bin')
22032203
: l10n.t('Move to Trash')

extensions/git/src/repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ export class Repository implements Disposable {
13491349

13501350
async clean(resources: Uri[]): Promise<void> {
13511351
const config = workspace.getConfiguration('git');
1352-
const untrackedChangesEnableTrash = config.get<boolean>('untrackedChangesEnableTrash', true) && !isRemote;
1352+
const discardUntrackedChangesToTrash = config.get<boolean>('discardUntrackedChangesToTrash', true) && !isRemote;
13531353

13541354
await this.run(
13551355
Operation.Clean(!this.optimisticUpdateEnabled()),
@@ -1388,7 +1388,7 @@ export class Repository implements Disposable {
13881388
}
13891389
});
13901390

1391-
if (untrackedChangesEnableTrash) {
1391+
if (discardUntrackedChangesToTrash) {
13921392
const limiter = new Limiter<void>(5);
13931393
await Promise.all(toClean.map(fsPath => limiter.queue(
13941394
async () => await workspace.fs.delete(Uri.file(fsPath), { useTrash: true }))));

0 commit comments

Comments
 (0)