Git - do not show warning dialog when you do a non-interactive worktree migration (#276177)

* Git - do not show warning dialog when you do a non-interactive worktree migration

* Fix condition 🤦‍♂️
This commit is contained in:
Ladislau Szomoru
2025-11-07 20:31:18 +00:00
committed by GitHub
parent 6e14077b6d
commit cc5d8fd3ee

View File

@@ -3462,12 +3462,15 @@ export class CommandCenter {
return; return;
} }
const message = l10n.t('Proceed with migrating changes to the current repository?'); if (worktreeUri === undefined) {
const detail = l10n.t('This will apply the worktree\'s changes to this repository and discard changes in the worktree.\nThis is IRREVERSIBLE!'); // Non-interactive migration, do not show confirmation dialog
const proceed = l10n.t('Proceed'); const message = l10n.t('Proceed with migrating changes to the current repository?');
const pick = await window.showWarningMessage(message, { modal: true, detail }, proceed); const detail = l10n.t('This will apply the worktree\'s changes to this repository and discard changes in the worktree.\nThis is IRREVERSIBLE!');
if (pick !== proceed) { const proceed = l10n.t('Proceed');
return; const pick = await window.showWarningMessage(message, { modal: true, detail }, proceed);
if (pick !== proceed) {
return;
}
} }
await worktreeRepository.createStash(undefined, true); await worktreeRepository.createStash(undefined, true);