shithub: opus

Download patch

ref: 61747bc6ec728de69d54db6ece90ad4617f059b8
parent: 1639592368fc2dadc82d63f3be6f17ed0b554d71
author: Tim-Philipp Müller <[email protected]>
date: Tue Apr 13 08:41:18 EDT 2021

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 <[email protected]>

--- a/meson/get-version.py
+++ b/meson/get-version.py
@@ -31,7 +31,7 @@
 
         # 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: