report() turned every nonzero exit of git merge-base into "<head> and
<base> have no common ancestor", so a mistyped or unfetched --head, a
tree or a blob was reported as unrelated history and git's own error was
dropped. Now only exit status 1 keeps that message, and any other
failure raises "git merge-base failed: <stderr>" like the merge-tree
call in conflicts(). git merge-base returns 1 when the histories share
no commit and dies with 128 when a revision does not resolve to a
commit. The tool still exits 2 in both cases, and
test_unrelated_histories_are_an_error now also checks that an invalid
head reports git's own merge-base error and not a missing common
ancestor.
main() resolved the base before running --fetch, so an explicit base on a
remote that was never fetched failed with "no base ref found" and never
fetched. The fetch is now a local helper and runs first when --base is
given; the default base still resolves first, then fetches.
Co-Authored-By: Claude Opus 5.5 <[email protected]>