Better fix ignores .git in all subdirs

This commit is contained in:
Philip Sargent 2020-03-26 11:38:41 +00:00
parent 8896417b7f
commit 645342dc96

View File

@ -19,13 +19,9 @@ allfilenames = []
detect = [] detect = []
clashes = [] clashes = []
report = [] report = []
for root, dirs, files in os.walk('.'): exclude = set([".git",".hg"])
if root.startswith('./.git'): for root, dirs, files in os.walk('.', topdown=True):
# Ignore .git directory. dirs[:] = [d for d in dirs if d not in exclude] # modifies dirs in-place.
continue
if root.startswith('./.hg'):
# Ignore mercurial directory.
continue
for filename in files: for filename in files:
if filename.endswith('~'): if filename.endswith('~'):
# Ignore automatically created backup files. # Ignore automatically created backup files.