diff options
-rwxr-xr-x | gitnoti.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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): |