Merge "Fix tests for GitPython>0.3.2.RC1"
diff --git a/requirements.txt b/requirements.txt
index dd947d6..4c85447 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,7 +5,7 @@
Paste
WebOb>=1.2.3,<1.3
paramiko>=1.8.0
-GitPython==0.3.2.RC1
+GitPython>=0.3.2.1
lockfile>=0.8
ordereddict
python-daemon
diff --git a/tests/base.py b/tests/base.py
index 46c7087..1cafc46 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -40,6 +40,7 @@
import six.moves.urllib.parse as urlparse
import statsd
import testtools
+from git import GitCommandError
import zuul.scheduler
import zuul.webapp
@@ -1031,9 +1032,12 @@
def ref_has_change(self, ref, change):
path = os.path.join(self.git_root, change.project)
repo = git.Repo(path)
- for commit in repo.iter_commits(ref):
- if commit.message.strip() == ('%s-1' % change.subject):
- return True
+ try:
+ for commit in repo.iter_commits(ref):
+ if commit.message.strip() == ('%s-1' % change.subject):
+ return True
+ except GitCommandError:
+ pass
return False
def job_has_changes(self, *args):