Check git version for --branch support. Fixes #2504