From b1e97812adfe619cae08ef1026e267fe84cc41df Mon Sep 17 00:00:00 2001 From: pandysong Date: Sat, 1 Aug 2020 00:15:36 +0800 Subject: [PATCH] Fix: assert == '.git' error If the '.git' is somewhere in the directories, even it is not configured in gitosis config, when it walks through all directory names, it will emit this assert error. The reason is that 'os.path.splitext(repo)' does not work as expected, as it returns '.git' and '' for the input '.git'. --- gitosis/gitdaemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitosis/gitdaemon.py b/gitosis/gitdaemon.py index 78ca9ea..5b77dab 100644 --- a/gitosis/gitdaemon.py +++ b/gitosis/gitdaemon.py @@ -66,6 +66,8 @@ def _error(e): to_recurse = [] repos = [] for dirname in dirnames: + if dirname == '.git': + continue if dirname.endswith('.git'): repos.append(dirname) else: