rename untrackedChangesEnableTrash to discardUntrackedChangesToTrash (#242186)

This commit is contained in:
João Moreno
2025-02-27 15:42:12 +01:00
committed by GitHub
parent bd4ab867f9
commit 6a06fb719e
4 changed files with 9 additions and 9 deletions

View File

@@ -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')

View File

@@ -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 }))));