Merge "Make encrypt_secret.py work with OpenSSL 0.x" into feature/zuulv3
diff --git a/tests/base.py b/tests/base.py
index 2a2f164..4de9134 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -499,7 +499,7 @@
             "refUpdate": {
                 "oldRev": oldrev,
                 "newRev": repo.heads[branch].commit.hexsha,
-                "refName": branch,
+                "refName": 'refs/heads/' + branch,
                 "project": project,
             }
         }
diff --git a/zuul/driver/gerrit/gerritconnection.py b/zuul/driver/gerrit/gerritconnection.py
index 59051bb..f4b090d 100644
--- a/zuul/driver/gerrit/gerritconnection.py
+++ b/zuul/driver/gerrit/gerritconnection.py
@@ -125,7 +125,9 @@
         # This checks whether the event created or deleted a branch so
         # that Zuul may know to perform a reconfiguration on the
         # project.
-        if event.type == 'ref-updated' and not event.ref.startswith('refs/'):
+        if (event.type == 'ref-updated' and
+            ((not event.ref.startswith('refs/')) or
+             event.ref.startswith('refs/heads'))):
             if event.oldrev == '0' * 40:
                 event.branch_created = True
                 event.branch = event.ref