From 8f0625c6b776b69bfcd6fa075482ab7e26d90b5e Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 26 Dec 2009 21:48:28 +0100 Subject: Don't fail when attempting to read incomplete repos. --- gitnoti.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gitnoti.py b/gitnoti.py index 58279c7..854d1e3 100755 --- a/gitnoti.py +++ b/gitnoti.py @@ -51,10 +51,16 @@ def check_repos(bot): bot.gitmsg('Removed repo%s: %s' % ('' if len(del_paths) == 1 else '', ', '.join([os.path.splitext(x)[0] for x in del_paths]))) for i in del_repos: repos.remove(i) + new_added = [] for i in new_paths: - repos.append([git.Repo('%s/%s' % (root, i)), None]) - if new_paths: - bot.gitmsg('New repo%s: %s' % ('' if len(new_paths) == 1 else 's', ', '.join([os.path.splitext(x)[0] for x in new_paths]))) + try: + r = git.Repo('%s/%s' % (root, i)) + repos.append([r, None]) + new_added.append(i) + except: + pass + if new_added: + bot.gitmsg('New repo%s: %s' % ('' if len(new_added) == 1 else 's', ', '.join([os.path.splitext(x)[0] for x in new_added]))) for i, v in enumerate(repos): repo = v[0] -- cgit v1.2.3