Note, the "proper" way of telling if the build is in a git working dir is `git rev-parse --is-inside-working-dir` but googling shows that didn't behave itself for older (but still supported) git versions (it fataled instead of nicely printing "false") so for now #3578 seems a reasonable fix for release 2.0.