summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsupport/download/git8
1 files changed, 6 insertions, 2 deletions
diff --git a/support/download/git b/support/download/git
index badb491efd..116e5a903a 100755
--- a/support/download/git
+++ b/support/download/git
@@ -33,10 +33,14 @@ cd "${BUILD_DIR}"
# Remove leftovers from a previous failed run
rm -rf "${repodir}"
+git_done=0
if [ -n "$(${GIT} ls-remote "${repo}" "${cset}" 2>&1)" ]; then
printf "Doing shallow clone\n"
- ${GIT} clone --depth 1 -b "${cset}" --bare "${repo}" "${repodir}"
-else
+ if ${GIT} clone --depth 1 -b "${cset}" --bare "${repo}" "${repodir}"; then
+ git_done=1
+ fi
+fi
+if [ ${git_done} -eq 0 ]; then
printf "Doing full clone\n"
${GIT} clone --bare "${repo}" "${repodir}"
fi
OpenPOWER on IntegriCloud