Skip to content

Commit 6181368

Browse files
committed
supported nested directories, removed duplicates
1 parent 681faee commit 6181368

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

gitcheck/gitcheck.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def showDebug(mess, level='info'):
7373
def searchRepositories():
7474
showDebug('Beginning scan... building list of git folders')
7575
dirs = argopts.get('searchDir', [os.path.abspath(os.getcwd())])
76-
repo = []
76+
repo = set()
7777
for curdir in dirs:
7878
if curdir[-1:] == '/':
7979
curdir = curdir[:-1]
@@ -87,12 +87,10 @@ def searchRepositories():
8787
if argopts.get('depth', None) is None or level <= argopts.get('depth', None):
8888
if '.git' in dirnames:
8989
showDebug(" Add %s repository" % directory)
90-
repo.append(directory)
90+
repo.add(directory)
9191

92-
repo.sort()
9392
showDebug('Done')
94-
return repo
95-
93+
return sorted(repo)
9694

9795
# Check state of a git repository
9896
def checkRepository(rep, branch):

0 commit comments

Comments
 (0)