directly call simplified merge editor for worktree merges (#265024)

directly call own simplified merge editor for worktree merges
This commit is contained in:
Christy 😺
2025-09-03 14:45:41 -07:00
committed by GitHub
parent a5afc1f17f
commit 901aa3b820
2 changed files with 29 additions and 1 deletions

View File

@@ -3536,6 +3536,8 @@ export class CommandCenter {
await worktreeRepository.popStash();
throw err;
}
repository.isWorktreeMigrating = true;
const message = l10n.t('There are merge conflicts from migrating changes. Please resolve them before committing.');
const show = l10n.t('Show Changes');
const choice = await window.showWarningMessage(message, show);
@@ -3546,6 +3548,22 @@ export class CommandCenter {
}
}
@command('git.openWorktreeMergeEditor')
async openWorktreeMergeEditor(uri: Uri): Promise<void> {
type InputData = { uri: Uri; title: string };
const mergeUris = toMergeUris(uri);
const current: InputData = { uri: mergeUris.ours, title: l10n.t('Workspace') };
const incoming: InputData = { uri: mergeUris.theirs, title: l10n.t('Worktree') };
await commands.executeCommand('_open.mergeEditor', {
base: mergeUris.base,
input1: current,
input2: incoming,
output: uri
});
}
@command('git.createWorktree')
async createWorktree(repository: any): Promise<void> {
repository = this.model.getRepository(repository);