Fix compatibility for git rev-parse without --symbolic-full-name