From d18e7a5fd56bf700c8abf8804a77adc55c09ff48 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Tue, 17 Feb 2015 18:34:31 -0800 Subject: [PATCH] Add support to fetch_git for shallow clones --- script-modules/fetch-rules.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script-modules/fetch-rules.sh b/script-modules/fetch-rules.sh index 0544efae..a964f327 100644 --- a/script-modules/fetch-rules.sh +++ b/script-modules/fetch-rules.sh @@ -24,8 +24,10 @@ fetch_git() { git submodule foreach git pull origin master fi else - echo "git clone \"$1\" \"$WORKDIR/$2\"" - git clone "$1" "$WORKDIR/$2" + clone_type= + [ -n "$SHALLOW_CLONE" ] && depth="--depth 1" + echo "git clone $depth \"$1\" \"$WORKDIR/$2\"" + git clone $depth "$1" "$WORKDIR/$2" if [ -n "$4" ]; then echo "cd \"$fetch_dir\"" cd "$fetch_dir"