summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgitnoti.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gitnoti.py b/gitnoti.py
index 3f2b757..b6aefcf 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -167,7 +167,11 @@ class ReposNotifyEvent(pyinotify.ProcessEvent):
self.bot.gitmsg('Repo %s was found but couldn''t locate refs/heads/ or refs/tags/ (repo NOT added).' % os.path.splitext(event.name)[0])
return
- repos[event.pathname] = NotifyRepo(self.bot, event.pathname)
+ try:
+ np = NotifyRepo(self.bot, event.pathname)
+ except git.exc.InvalidGitRepositoryError:
+ self.bot.gitmsg('Invalid repo: %s' % os.path.splitext(event.name)[0])
+ repos[event.pathname] = np
self.bot.gitmsg('New repo: %s' % os.path.splitext(event.name)[0])
def process_IN_CREATE(self, event):