From d867f3d470bcc5548468fe3cc72786a971ffdfac Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Fri, 30 Dec 2016 10:23:25 -0600 Subject: [PATCH] fetch: fix check for local ref path This is a fast case if the slave has a local checkout available so that it doesn't have to do a full clone. The check unfortunately didn't take into account all cases and failed on the new slave. --- scripts/fetch.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/fetch.sh b/scripts/fetch.sh index 4a777fa..f8639a9 100755 --- a/scripts/fetch.sh +++ b/scripts/fetch.sh @@ -40,11 +40,11 @@ update_repo() { git fetch origin || die "unable to fetch ${uri}" else echo "Cloning '${path}'" - if [ -z "${GIT_LOCAL_REF_DIR}" ]; then - git clone ${uri} ${path} || die "unable to clone ${uri}" - else + if [ -d "${GIT_LOCAL_REF_DIR}" ]; then git clone --reference ${GIT_LOCAL_REF_DIR}/`basename ${path}` \ - ${uri} ${path} || die "unable to clone ${uri}" + ${uri} ${path} || die "unable to clone ${uri}" + else + git clone ${uri} ${path} || die "unable to clone ${uri}" fi pushd ${path} > /dev/null fi