meson: quote --git-dir argument

This commit is contained in:
Daniel Eklöf 2019-05-09 18:56:40 +02:00
parent 660d8165f5
commit f1fad90338

View file

@ -14,12 +14,12 @@ git = find_program('git', required: false, native: true)
if git.found() if git.found()
commit_hash = run_command( commit_hash = run_command(
[sh.path(), '-c', [sh.path(), '-c',
'@0@ --git-dir=$MESON_SOURCE_ROOT/.git describe --always --tags'.format( '@0@ --git-dir="$MESON_SOURCE_ROOT/.git" describe --always --tags'.format(
git.path())]) git.path())])
branch = run_command( branch = run_command(
[sh.path(), '-c', [sh.path(), '-c',
'@0@ --git-dir=$MESON_SOURCE_ROOT/.git rev-parse --abbrev-ref HEAD'.format( '@0@ "--git-dir=$MESON_SOURCE_ROOT/.git" rev-parse --abbrev-ref HEAD'.format(
git.path())]) git.path())])
if commit_hash.returncode() == 0 and branch.returncode() == 0 if commit_hash.returncode() == 0 and branch.returncode() == 0