Make it possible to specify the HEAD for the internal findUpstreamBranchPoint function.