that's interesting. I'm on 1.8.3.2 and the same command return 0.
Could you please check if git reset -q HEAD -- test returns 0? According to the docs the -q flag should only report errors.
Another way would be exposing the git version from the binary (this could be useful per se) and skipping the test based on that version...

But...a semver parsing library could be necessary....do you know any?