Fixed #575 (issue with merge-base always returning the current head commit)