summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2009-12-26 21:48:28 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2009-12-26 21:48:28 +0100
commit8f0625c6b776b69bfcd6fa075482ab7e26d90b5e (patch)
treeddd5efe689fa97c0091cea28b5c345aa1287923b
parent48dde861b419fc850285869d4e3b27300b2d547f (diff)
Don't fail when attempting to read incomplete repos.
-rwxr-xr-xgitnoti.py12
1 files 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]