diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2009-10-17 00:26:48 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2009-10-17 00:26:48 +0200 |
commit | 48dde861b419fc850285869d4e3b27300b2d547f (patch) | |
tree | cf0d853823c3096fd5f91636796b6a1260fad68d | |
parent | 7b6aae8dbdb3e0756e96419ca2c6d3890e8b94d7 (diff) |
Use repo.heads instead of repo.commits() and check for empty list.
-rwxr-xr-x | gitnoti.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -58,11 +58,13 @@ def check_repos(bot): for i, v in enumerate(repos): repo = v[0] + if not repo.heads: # No commits + continue last = v[1] if last == None: - last = repo.commits()[0].id + last = repo.heads[0].commit.id repos[i][1] = last - nlast = repo.commits()[0] + nlast = repo.heads[0].commit if last and nlast.id != last: msg = repo_commit_msg(repo, nlast) bot.gitmsg(msg) @@ -99,7 +101,7 @@ class Bot(irc.IRCClient): repo = [r for r in repos if os.path.basename(r[0].path).startswith(repo)] if len(repo) == 1: r = repo[0][0] - msg = repo_commit_msg(r, r.commits()[0]) + msg = repo_commit_msg(r, r.heads[0].commit) self.msg(target, msg) elif len(repo) == 0: self.msg(target, 'No repo found.') |