From e2797755116725afb85eca6829d071b650cbe899 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 29 Jan 2019 14:41:11 -0800 Subject: [PATCH] dist: Handle git worktrees, which have a .git file instead of dir This is the second most straight forward stupid way of handling this (with usiing os.path.exists) as the most stupid obvious way. The only major advantage is that having .git as something other than a file or directory still doesn't register. Fixes: #3378 --- mesonbuild/scripts/dist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/scripts/dist.py b/mesonbuild/scripts/dist.py index f49492c43..a8d9674b2 100644 --- a/mesonbuild/scripts/dist.py +++ b/mesonbuild/scripts/dist.py @@ -188,7 +188,8 @@ def run(args): dist_name = build.project_name + '-' + build.project_version - if os.path.isdir(os.path.join(src_root, '.git')): + _git = os.path.join(src_root, '.git') + if os.path.isdir(_git) or os.path.isfile(_git): names = create_dist_git(dist_name, src_root, bld_root, dist_sub, build.dist_scripts) elif os.path.isdir(os.path.join(src_root, '.hg')): names = create_dist_hg(dist_name, src_root, bld_root, dist_sub, build.dist_scripts)