ExternalProject: Only add git config setting with git 1.7.7 or later

1cb65e68 (ExternalProject: Prevent the noisy detached head
messages on checkout, 2021-01-17) unconditionally added the advice.detachedHead
git config setting, but it requires git 1.7.7 or later. Since it isn't fatal to not
have it, just noisier, only add it when it is supported.

Fixes: #22206
41 jobs for !6145 with git-config-version-check in 20 minutes and 49 seconds (queued for 5 seconds)
latest detached
Status Name Job ID Coverage
  Build
manual build:centos6-x86_64 #5806669
cmake build docker linux manual
passed build:debian10-iwyu #5806666
cmake build docker linux

00:02:02

manual build:fedora33-ninja #5806670
cmake build docker linux linux-3.17 manual
passed build:fedora33-sphinx #5806668
cmake build docker linux linux-3.17

00:07:28

passed build:fedora33-tidy #5806667
cmake build docker linux linux-3.17

00:20:49

manual build:macos-x86_64-makefiles #5806672
cmake macos shell xcode-12.4 nonconcurrent manual
manual build:macos-x86_64-ninja #5806671
cmake macos shell xcode-12.4 nonconcurrent manual
manual build:windows-vs2019-x64-ninja #5806673
cmake windows shell vs2019 msvc-19.28-16.9 nonconcurrent manual
 
  Test
created test:fedora33-ninja #5806674
cmake docker linux linux-3.17 x11
created test:macos-x86_64-makefiles #5806676
cmake macos shell xcode-12.4 nonconcurrent
created test:macos-x86_64-ninja #5806675
cmake macos shell xcode-12.4 nonconcurrent
created test:windows-vs2019-x64-ninja #5806677
shell vs2019 msvc-19.28-16.9 nonconcurrent cmake windows
 
  Test Ext
created test:cuda10.2-nvidia #5806680
cmake cuda-rt docker linux
created test:debian10-ninja #5806678
cmake build docker linux linux-3.17
created test:fedora33-makefiles #5806679
cmake build docker linux linux-3.17
created test:fedora33-ninja-multi #5806681
cmake build docker linux linux-3.17
created test:macos-x86_64-xcode #5806682
cmake macos shell xcode-12.4 concurrent
created test:windows-vs2019-x64 #5806683
cmake windows shell vs2019 msvc-19.28-16.9 concurrent
 
  External
passed cdash

passed ghostflow-check-master

passed ghostflow-check-release

passed ghostflow-stager

passed cdash

passed cdash

passed cdash

passed cdash

passed cdash

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager