diff options
-rw-r--r-- | mesonbuild/mdist.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index 22196d8..e63ab17 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') |