diff options
-rwxr-xr-x | gitnoti.py | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -1,5 +1,21 @@ #!/usr/bin/env python +# gitnotipy - An IRC bot which announces changes to a collection of git repositories +# Copyright (C) 2009-2010 Jon Bergli Heier + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + import git, os, sys, time, pyinotify, netrc from optparse import OptionParser from twisted.words.protocols import irc @@ -227,13 +243,14 @@ class Bot(irc.IRCClient): def get_commits(self, repo, name): try: if '..' in name: - frm, to = name.split('..') - commits = list(repo.iter_commits('%s..%s' % (frm, to))) + commits = list(repo.iter_commits(name)) else: commits = [repo.commit(name)] except ValueError: return [] - except git.errors.GitCommandError: + except git.exc.BadObject: + return [] + except git.exc.GitCommandError: return [] return commits |