meson: fix get-version script for git worktrees

For git worktree directories .git is not a directory
but a file that points to the real .git dir.

The `update_version` script used by other builds
works correctly with git worktrees.

Signed-off-by: Ralph Giles <giles@thaumas.net>
This commit is contained in:
Tim-Philipp Müller 2021-04-13 12:41:18 +01:00 committed by Ralph Giles
parent 1639592368
commit 61747bc6ec
No known key found for this signature in database
GPG key ID: 9259A8F2D2D44C84

View file

@ -31,7 +31,7 @@ if __name__ == '__main__':
# check if git checkout
git_dir = os.path.join(srcroot, '.git')
is_git = os.path.isdir(git_dir)
is_git = os.path.isdir(git_dir) or os.path.isfile(git_dir)
have_git = shutil.which('git') is not None
if is_git and have_git: