summaryrefslogtreecommitdiff
path: root/gitnoti.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitnoti.py')
-rwxr-xr-xgitnoti.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gitnoti.py b/gitnoti.py
index ca06482..58279c7 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -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.')