diff --git a/meson.build b/meson.build index 0476d972d0..2576153536 100644 --- a/meson.build +++ b/meson.build @@ -815,7 +815,7 @@ endif time_epoch = get_option('time-epoch') if time_epoch <= 0 time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"', check : true).stdout().strip() - if time_epoch == '' and git.found() and fs.exists('.git') + if time_epoch == '' and git.found() and fs.is_dir('.git') # If we're in a git repository, use the creation time of the latest git tag. latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags', check : false) diff --git a/test/fuzz/meson.build b/test/fuzz/meson.build index f7f0a6111c..a8fb71c566 100644 --- a/test/fuzz/meson.build +++ b/test/fuzz/meson.build @@ -50,7 +50,7 @@ sanitize_address_undefined = custom_target( fuzz_sanitizers = [['address,undefined', sanitize_address_undefined]] fuzz_testsdir = 'test/fuzz' -if git.found() and fs.exists(project_source_root / '.git') +if git.found() and fs.is_dir(project_source_root / '.git') out = run_command(env, '-u', 'GIT_WORK_TREE', git, '--git-dir=@0@/.git'.format(project_source_root), 'ls-files', ':/@0@/*/*'.format(fuzz_testsdir), diff --git a/test/meson.build b/test/meson.build index 93f0e679fe..a051f77a52 100644 --- a/test/meson.build +++ b/test/meson.build @@ -187,7 +187,7 @@ endif if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family()) udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh') - if git.found() and fs.exists(project_source_root / '.git') + if git.found() and fs.is_dir(project_source_root / '.git') out = run_command( env, '-u', 'GIT_WORK_TREE', git, '--git-dir=@0@/.git'.format(project_source_root),