Verify that the two tips have exactly one merge base.

There might be a way to merge even in more complicated scenarios, but
for now limit ourselves to the more understandable case.
Restrict commits on each branch to the ancestry path with merge_base.

In a case like this:

o - 0 - 1 - 2 - 3 - 4    ← master
     \       \
      A - B - C - D      ← branch
           \     /
            X - Y

the old algorithm would give commits A,B,C,D for branch.  This is
obviously nonsense: it doesn't make sense merging commits that are not
descendants of the merge base.  So out of the --first-parent lists,
include only the commits that are on the ancestry paths.

Unfortunately, "git rev-list" does not work correctly if options
"--first-parent" and "--ancestry-path" are used together, so we have
to run the command twice and compute the intersection ourselves.
Merge branch 'ancestry-path'

Fix the computation of the commits on each branch to only include
commits on the ancestry path (i.e., descendants of the merge base).