This walks through each ancestor, finding the branches for each (which is itself slow, taking around 3s per branch locally, as `git branch -a --contains refish` has to walk each and every ref, but less obvious how to speed up). We can often make a conservative first guess, which means we can then bisect the ancestors to find the appropriate branch point.
Pull request: https://github.com/WebKit/WebKit/pull/3149
<rdar://problem/98729282>