diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2009-12-26 21:48:28 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2009-12-26 21:48:28 +0100 |
commit | 8f0625c6b776b69bfcd6fa075482ab7e26d90b5e (patch) | |
tree | ddd5efe689fa97c0091cea28b5c345aa1287923b | |
parent | 48dde861b419fc850285869d4e3b27300b2d547f (diff) |
Don't fail when attempting to read incomplete repos.
-rwxr-xr-x | gitnoti.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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] |