test(FN-3842): align finalize-result assertions and docs

This commit is contained in:
Fusion
2026-05-09 09:11:45 -07:00
committed by gsxdsm
parent 497c91b845
commit 4a1202c46c
2 changed files with 6 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ describe("commitOrAmendMergeWithFixes no-op finalize", () => {
new Set<string>(),
);
expect(result).toBe(true);
expect(result.ok).toBe(true);
const committedFiles = git(dir, "git diff --name-only HEAD~1 HEAD").split("\n").filter(Boolean);
expect(committedFiles).toContain("feature-a.ts");
});
@@ -100,6 +100,7 @@ describe("commitOrAmendMergeWithFixes no-op finalize", () => {
new Set<string>(),
);
expect(result).toBe(false);
expect(result.ok).toBe(false);
expect(result.reason).toBe("unknown-phantom");
});
});

View File

@@ -2558,8 +2558,9 @@ async function buildDeterministicMergeMessage(params: {
* modified are staged. Any other dirty files in the working tree are left
* untouched and a warning is emitted for each one.
*
* Returns true on a successful commit/amend. Never throws — errors are logged
* and the function returns false (callers decide whether to abort the merge).
* Returns a structured result with `{ ok: true, reason: ... }` on success or
* `{ ok: false, reason: ... }` on failure. Never throws — errors are logged and
* callers decide whether to abort the merge based on the returned reason.
*
* @internal Exported for integration tests only — not part of the public API.
*/