mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-22 19:29:17 +00:00
clean up dialog and add additional warning (#263908)
* restrict dialog to less than 5 files * add warning dialog
This commit is contained in:
@@ -3451,12 +3451,26 @@ export class CommandCenter {
|
||||
|
||||
// Check for 'LocalChangesOverwritten' error
|
||||
if (conflicts.length > 0) {
|
||||
const fileList = conflicts.join('\n ');
|
||||
const maxFilesShown = 5;
|
||||
const filesToShow = conflicts.slice(0, maxFilesShown);
|
||||
const remainingCount = conflicts.length - maxFilesShown;
|
||||
|
||||
const fileList = filesToShow.join('\n ') +
|
||||
(remainingCount > 0 ? l10n.t('\n and {0} more file{1}...', remainingCount, remainingCount > 1 ? 's' : '') : '');
|
||||
|
||||
const message = l10n.t('Your local changes to the following files would be overwritten by merge:\n {0}\n\nPlease stage, commit, or stash your changes in the repository before migrating changes.', fileList);
|
||||
await window.showErrorMessage(message, { modal: true });
|
||||
return;
|
||||
}
|
||||
|
||||
const message = l10n.t('Proceed with migrating changes to the current repository?');
|
||||
const detail = l10n.t('This will apply the worktree\'s changes to this repository and discard changes in the worktree.\nThis is IRREVERSIBLE!');
|
||||
const proceed = l10n.t('Proceed');
|
||||
const pick = await window.showWarningMessage(message, { modal: true, detail }, proceed);
|
||||
if (pick !== proceed) {
|
||||
return;
|
||||
}
|
||||
|
||||
await worktreeRepository.createStash(undefined, true);
|
||||
const stashes = await worktreeRepository.getStashes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user