From 55582f497e0e0629f13a03165b59ca033cb4a207 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 28 Nov 2010 20:37:14 +0100 Subject: Assume initial commit or orphan branch when no 'last' commit is set or no parents exists. --- gitnoti.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitnoti.py b/gitnoti.py index 528f42b..6ffcec2 100755 --- a/gitnoti.py +++ b/gitnoti.py @@ -165,8 +165,8 @@ class ReposNotifyEvent(pyinotify.ProcessEvent): commits = list(repo.iter_commits('%s..%s' % (last, h.name))) elif len(h.commit.parents): # Check against parent commit commits = list(repo.iter_commits('%s..%s' % (h.commit.parents[0], h.name))) - else: # No valid commits to check against - continue + else: # Initial commit or orphan branch was pushed + commits = list(repo.iter_commits(h.name)) if not len(commits): # No commits continue -- cgit v1.2.3