From 59d52f307b8fee53c29cda803ba3d1848ef91a8b Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Sat, 17 Jan 2015 11:29:12 -0800 Subject: [PATCH] Disable shallow cloning with GIT_DEPTH=0 The recent patch to enable shallow cloning added a method to skip it by checking if GIT_DEPTH was null. However, this could never be triggered because if the user specified it as null, the default setting code would take over and set it to 1. This patch allows the user to specify GIT_DEPTH=0 to skip the shallow clone. Change-Id: I00ea7ab54ed51dc3ede9ceb9ff0f11575a035d1c --- functions-common | 2 +- stackrc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/functions-common b/functions-common index 5bca836d37..7be0a92a72 100644 --- a/functions-common +++ b/functions-common @@ -601,7 +601,7 @@ function git_clone { local git_clone_flags="" RECLONE=$(trueorfalse False RECLONE) - if [[ -n "${GIT_DEPTH}" ]]; then + if [[ "${GIT_DEPTH}" -gt 0 ]]; then git_clone_flags="$git_clone_flags --depth $GIT_DEPTH" fi diff --git a/stackrc b/stackrc index 25682027df..2dd56e8104 100644 --- a/stackrc +++ b/stackrc @@ -697,7 +697,8 @@ SYSLOG_PORT=${SYSLOG_PORT:-516} LOG_COLOR=$(trueorfalse True LOG_COLOR) # Set global ``GIT_DEPTH=`` to limit the history depth of the git clone -GIT_DEPTH=${GIT_DEPTH:-1} +# Set to 0 to disable shallow cloning +GIT_DEPTH=${GIT_DEPTH:-0} # Use native SSL for servers in SSL_ENABLED_SERVICES USE_SSL=$(trueorfalse False USE_SSL)