From 186c917afdc62ee8eba6820c8564dcd569fdb4fe Mon Sep 17 00:00:00 2001
From: Gregory Haynes <greg@greghaynes.net>
Date: Fri, 8 May 2015 17:00:55 +0000
Subject: [PATCH] Clone DIB repos with git before zuul-cloner

Work around a bug causing zuul-cloner to explode when cleaning up the
DIB git repos.

Change-Id: I4c21122f3e1a6c64480c66daf3c69b5a22b9eff1
---
 jenkins/jobs/diskimage-builder.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/jenkins/jobs/diskimage-builder.yaml b/jenkins/jobs/diskimage-builder.yaml
index b89145cf5d..64e0fb94af 100644
--- a/jenkins/jobs/diskimage-builder.yaml
+++ b/jenkins/jobs/diskimage-builder.yaml
@@ -7,6 +7,11 @@
       - shell: |
           #!/bin/bash -eux
           cd ~
+
+          # Work around a bug where we get a disconnected HEAD ref if we dont clone with git first
+          git clone file:///opt/git/openstack/diskimage-builder openstack/diskimage-builder
+          git clone file:///opt/git/openstack/dib-utils openstack/dib-utils
+
           /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
             git://git.openstack.org \
             openstack/diskimage-builder \