diff --git a/extensions/git/package.json b/extensions/git/package.json index e35d19e0fb0..23feced6ea1 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -3323,10 +3323,10 @@ "markdownDescription": "%config.diagnosticsCommitHook.Sources%", "scope": "resource" }, - "git.untrackedChangesEnableTrash": { + "git.discardUntrackedChangesToTrash": { "type": "boolean", "default": true, - "markdownDescription": "%config.untrackedChangesEnableTrash%" + "markdownDescription": "%config.discardUntrackedChangesToTrash%" } } }, diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index dcd6783a735..ec511106e14 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -288,7 +288,7 @@ "config.commitShortHashLength": "Controls the length of the commit short hash.", "config.diagnosticsCommitHook.Enabled": "Controls whether to check for unresolved diagnostics before committing.", "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`.", - "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.", + "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.", "submenu.explorer": "Git", "submenu.commit": "Commit", "submenu.commit.amend": "Amend", diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 43746097e20..0c2d805bb03 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -2175,9 +2175,9 @@ export class CommandCenter { private getDiscardUntrackedChangesDialogDetails(resources: Resource[]): [string, string, string] { const config = workspace.getConfiguration('git'); - const untrackedChangesEnableTrash = config.get('untrackedChangesEnableTrash', true) && !isRemote; + const discardUntrackedChangesToTrash = config.get('discardUntrackedChangesToTrash', true) && !isRemote; - const messageWarning = !untrackedChangesEnableTrash + const messageWarning = !discardUntrackedChangesToTrash ? resources.length === 1 ? '\n\nThis is IRREVERSIBLE!\nThis file will be FOREVER LOST if you proceed.' : '\n\nThis is IRREVERSIBLE!\nThese files will be FOREVER LOST if you proceed.' @@ -2187,7 +2187,7 @@ export class CommandCenter { ? l10n.t('Are you sure you want to DELETE the following untracked file: \'{0}\'?{1}', path.basename(resources[0].resourceUri.fsPath), messageWarning) : l10n.t('Are you sure you want to DELETE the {0} untracked files?{1}', resources.length, messageWarning); - const messageDetail = untrackedChangesEnableTrash + const messageDetail = discardUntrackedChangesToTrash ? isWindows ? resources.length === 1 ? 'You can restore this file from the Recycle Bin.' @@ -2197,7 +2197,7 @@ export class CommandCenter { : 'You can restore these files from the Trash.' : ''; - const primaryAction = untrackedChangesEnableTrash + const primaryAction = discardUntrackedChangesToTrash ? isWindows ? l10n.t('Move to Recycle Bin') : l10n.t('Move to Trash') diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index ac1832aada9..c537bb23ff1 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -1349,7 +1349,7 @@ export class Repository implements Disposable { async clean(resources: Uri[]): Promise { const config = workspace.getConfiguration('git'); - const untrackedChangesEnableTrash = config.get('untrackedChangesEnableTrash', true) && !isRemote; + const discardUntrackedChangesToTrash = config.get('discardUntrackedChangesToTrash', true) && !isRemote; await this.run( Operation.Clean(!this.optimisticUpdateEnabled()), @@ -1388,7 +1388,7 @@ export class Repository implements Disposable { } }); - if (untrackedChangesEnableTrash) { + if (discardUntrackedChangesToTrash) { const limiter = new Limiter(5); await Promise.all(toClean.map(fsPath => limiter.queue( async () => await workspace.fs.delete(Uri.file(fsPath), { useTrash: true }))));