We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48a7a23 commit c22027dCopy full SHA for c22027d
1 file changed
gitcheck/gitcheck.py
@@ -82,12 +82,15 @@ def searchRepositories():
82
html.path = curdir
83
startinglevel = curdir.count(os.sep)
84
85
- for directory, dirnames, filenames in os.walk(curdir):
+ for directory, dirnames, filenames in os.walk(curdir, topdown=True):
86
level = directory.count(os.sep) - startinglevel
87
- if argopts.get('depth', None) is None or level <= argopts.get('depth', None):
88
- if '.git' in dirnames:
89
- showDebug(" Add %s repository" % directory)
90
- repo.add(directory)
+
+ if '.git' in dirnames:
+ showDebug(" Add %s repository" % directory)
+ repo.add(directory)
91
92
+ if argopts.get('depth', None) is not None and level >= argopts.get('depth', None):
93
+ dirnames[:] = []
94
95
showDebug('Done')
96
return sorted(repo)
0 commit comments