Merge "Prune old branches when updating cache"

This commit is contained in:
Jenkins 2016-01-14 00:03:28 +00:00 committed by Gerrit Code Review
commit d5da803ff8
1 changed files with 1 additions and 1 deletions

View File

@ -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