fix(worker): block approve of a planning parent with an unfinished child, surface git stderr on ff failure

This commit is contained in:
mika kuns
2026-10-01 11:36:45 +02:00
parent a353897345
commit acd188bca9
5 changed files with 40 additions and 3 deletions
@@ -88,8 +88,9 @@ public sealed class UnitBranchService
var (code, stderr) = await _git.MergeFastForwardOnlyAsync(parentWt.Path, childWt.BranchName, ct);
if (code != 0)
return new AbsorbResult(true,
$"Unit branch '{parentWt.BranchName}' cannot be fast-forwarded to '{childWt.BranchName}' — the child " +
$"did not start from the unit's current head (e.g. it was run in parallel via Run now). git: {stderr}");
$"Unit branch '{parentWt.BranchName}' cannot be fast-forwarded to '{childWt.BranchName}': {stderr.Trim()} " +
"(usually the child did not start from the unit's current head, e.g. run in parallel via Run now, " +
"or the unit worktree has local changes)");
var head = await _git.RevParseHeadAsync(parentWt.Path, ct);
var diffStat = await _git.DiffStatAsync(parentWt.Path, parentWt.BaseCommit, head, ct: ct);