From aef91b51bb434aa6d3f97bcb9281e6cb508321fa Mon Sep 17 00:00:00 2001 From: chyoo Date: Tue, 7 Jul 2026 18:07:30 +0900 Subject: [PATCH] handle unrelated history promotion fallback --- src/apps/apps.service.ts | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/apps/apps.service.ts b/src/apps/apps.service.ts index 1e11d34..120477a 100644 --- a/src/apps/apps.service.ts +++ b/src/apps/apps.service.ts @@ -714,13 +714,27 @@ export class AppsService { if (!isUnrelatedHistoryError(message)) { throw error; } - await execFileAsync(gitBin, [ - ...mergeOptions, - 'merge', - '--allow-unrelated-histories', - '--no-ff', - commitSha, - ], { cwd: workDir }); + try { + await execFileAsync(gitBin, [ + ...mergeOptions, + 'merge', + '--allow-unrelated-histories', + '--no-ff', + '--no-edit', + commitSha, + ], { cwd: workDir }); + } catch { + await execFileAsync(gitBin, [ + ...mergeOptions, + 'merge', + '--allow-unrelated-histories', + '--no-ff', + '--no-edit', + '-X', + 'theirs', + commitSha, + ], { cwd: workDir }); + } } } else { await execFileAsync(gitBin, [