From 4573d0d930c070a113891709cb50972a8c4d1016 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 12 Jan 2016 11:25:43 +1100 Subject: [PATCH] Prune old branches when updating cache dib builds are failing in nodepool at the moment trying to download a really old Fedora image. What happens is that the devstack cache script [1] goes through all the branches of the devstack checkout and uses the inbuilt image-list tool [2] to get its list of images to pre-download. One of the old Fedora images required on the retired branches has now gone, so the build halts with a 404 trying to get it. Thus make sure we do a --prune when we fetch changes so that old branches are removed from the cache. [1] https://git.openstack.org/cgit/openstack-infra/project-config/tree/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos [2] https://git.openstack.org/cgit/openstack-dev/devstack/tree/tools/image_list.sh Change-Id: Ieb6a6e9f55bd93f63c3d0a71828c276c2d02e1b9 --- .../source-repositories/extra-data.d/98-source-repositories | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/source-repositories/extra-data.d/98-source-repositories b/elements/source-repositories/extra-data.d/98-source-repositories index 17228039f..cc15f2bfe 100755 --- a/elements/source-repositories/extra-data.d/98-source-repositories +++ b/elements/source-repositories/extra-data.d/98-source-repositories @@ -125,7 +125,7 @@ function get_repos_for_element(){ echo "Updating cache of $REPOLOCATION in $CACHE_PATH with ref $REPOREF" # Copy named refs (which might be outside the usual heads # pattern) - e.g. gerrit - if [ "$REPOREF" == "*" ] || ! git --git-dir=$CACHE_PATH/.git fetch --update-head-ok $REPOLOCATION \ + if [ "$REPOREF" == "*" ] || ! git --git-dir=$CACHE_PATH/.git fetch --prune --update-head-ok $REPOLOCATION \ +${REPOREF}:${REPOREF} ; then # Copy all heads from the remote repository - this permits # using a SHA1 object reference so long as the object