From d0101cbfb7dbf6c61e739f682c4cf08ceea1e3e7 Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Thu, 1 Jul 2021 19:38:15 +0200 Subject: dist: only exclude actual git files Instead of excluding all files starting with .git, meson dist now only excludes files really used by git --- mesonbuild/mdist.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index 22196d826..e63ab1783 100644 --- a/mesonbuild/mdist.py +++ b/mesonbuild/mdist.py @@ -56,11 +56,13 @@ def create_hash(fname): def del_gitfiles(dirname): + gitfiles = ('.git', '.gitattributes', '.gitignore', '.gitmodules') for f in glob(os.path.join(dirname, '.git*')): - if os.path.isdir(f) and not os.path.islink(f): - windows_proof_rmtree(f) - else: - os.unlink(f) + if os.path.split(f)[1] in gitfiles: + if os.path.isdir(f) and not os.path.islink(f): + windows_proof_rmtree(f) + else: + os.unlink(f) def process_submodules(dirname): module_file = os.path.join(dirname, '.gitmodules') -- cgit v1.2.3