meson: correct git detection

The current "building from git" test uses "test -d .git"; however, that
doesn't work when libvirt is used as a submodule, as in that case .git
is a normal file. Use "test -e .git" instead.

Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
John Levon 2024-07-24 09:56:04 +01:00 committed by Michal Privoznik
parent e5232f6fd6
commit ce9c9e315f

View File

@ -17,7 +17,7 @@ endif
# figure out if we are building from git
git = run_command('test', '-d', '.git', check: false).returncode() == 0
git = run_command('test', '-e', '.git', check: false).returncode() == 0
if git and not get_option('no_git')
run_command('git', 'submodule', 'update', '--init', check: true)