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 = []
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.