Skip to content

Instantly share code, notes, and snippets.

@caktux
Created October 15, 2014 02:59
Show Gist options
  • Save caktux/2f087dc964f3b5a3215f to your computer and use it in GitHub Desktop.
Save caktux/2f087dc964f3b5a3215f to your computer and use it in GitHub Desktop.
diff --git a/master/buildbot/changes/gitpoller.py b/master/buildbot/changes/gitpoller.py
index f3d7fb1..4a11108 100644
--- a/master/buildbot/changes/gitpoller.py
+++ b/master/buildbot/changes/gitpoller.py
@@ -242,11 +242,13 @@ class GitPoller(base.PollingChangeSource, StateMixin):
lastRev = self.lastRev.get(branch)
self.lastRev[branch] = newRev
- if not lastRev:
- return
# get the change list
- revListArgs = [r'--format=%H', '%s..%s' % (lastRev, newRev), '--']
+ if lastRev:
+ revListArgs = [r'--format=%H', '%s..%s' % (lastRev, newRev), '--']
+ else:
+ revListArgs = [r'--format=%H', '%s~..%s' % (newRev, newRev), '--']
+
self.changeCount = 0
results = yield self._dovccmd('log', revListArgs, path=self.workdir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment