Implement git_merge_base_octopus

#2156