fix getting heads from empty repo