From 645342dc966bf1bd6d01893227e8b64338073505 Mon Sep 17 00:00:00 2001 From: "Philip Sargent (muscogee)" Date: Thu, 26 Mar 2020 11:38:41 +0000 Subject: [PATCH] Better fix ignores .git in all subdirs --- scripts/detect-filename-clashes.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/detect-filename-clashes.py b/scripts/detect-filename-clashes.py index 5794537f5..bdfe564e5 100644 --- a/scripts/detect-filename-clashes.py +++ b/scripts/detect-filename-clashes.py @@ -19,13 +19,9 @@ allfilenames = [] detect = [] clashes = [] report = [] -for root, dirs, files in os.walk('.'): - if root.startswith('./.git'): - # Ignore .git directory. - continue - if root.startswith('./.hg'): - # Ignore mercurial directory. - continue +exclude = set([".git",".hg"]) +for root, dirs, files in os.walk('.', topdown=True): + dirs[:] = [d for d in dirs if d not in exclude] # modifies dirs in-place. for filename in files: if filename.endswith('~'): # Ignore automatically created backup files.