mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
rename untrackedChangesEnableTrash to discardUntrackedChangesToTrash (#242186)
This commit is contained in:
@@ -2175,9 +2175,9 @@ export class CommandCenter {
|
||||
|
||||
private getDiscardUntrackedChangesDialogDetails(resources: Resource[]): [string, string, string] {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const untrackedChangesEnableTrash = config.get<boolean>('untrackedChangesEnableTrash', true) && !isRemote;
|
||||
const discardUntrackedChangesToTrash = config.get<boolean>('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')
|
||||
|
||||
@@ -1349,7 +1349,7 @@ export class Repository implements Disposable {
|
||||
|
||||
async clean(resources: Uri[]): Promise<void> {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const untrackedChangesEnableTrash = config.get<boolean>('untrackedChangesEnableTrash', true) && !isRemote;
|
||||
const discardUntrackedChangesToTrash = config.get<boolean>('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<void>(5);
|
||||
await Promise.all(toClean.map(fsPath => limiter.queue(
|
||||
async () => await workspace.fs.delete(Uri.file(fsPath), { useTrash: true }))));
|
||||
|
||||
Reference in New Issue
Block a user