Accept more forms of git versions

Fixes the parsing of “git version 1.9.3 (Apple Git-50)”.
Closes #2653.