Prune old branches in early devstack clone

In a rather confusing addendum to
Ieb6a6e9f55bd93f63c3d0a71828c276c2d02e1b9, we have actually mirrored a
version of the source-repo script from dib and munged it to cache
devstack early so we can use it to find the vm images to download and
cache.

However, we are not ensuring that we remove old branches in this
clone, which is leading to the problems of us picking up images from
old branches that don't exist any more.

Change-Id: I41e81d6bac98875eecde2376e0865784626e11a8
This commit is contained in:
Ian Wienand 2016-01-18 13:30:19 +11:00
parent 1789b8c0b9
commit 53832d82cd
1 changed files with 2 additions and 1 deletions

View File

@ -128,7 +128,8 @@ function get_repos_for_element(){
HAS_REF=$(git --git-dir=$CACHE_PATH/.git name-rev $REPOREF 2>/dev/null || true)
if [ -z "$DIB_OFFLINE" -o -z "$HAS_REF" ] ; then
echo "Updating cache of $REPOLOCATION in $CACHE_PATH with ref $REPOREF"
git --git-dir=$CACHE_PATH/.git fetch --update-head-ok $REPOLOCATION +refs/heads/*:refs/heads/*
git --git-dir=$CACHE_PATH/.git fetch --update-head-ok --prune \
$REPOLOCATION +refs/heads/*:refs/heads/*
fi
echo "Cloning from $REPONAME cache and applying ref $REPOREF"