From bcaac23c3c4f066612f9a2e45105acdf6152de0e Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 1 Jun 2011 19:37:12 +0200 Subject: Report invalid repos. --- gitnoti.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3