File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -135,15 +135,19 @@ git_clone()
135135 local odir=$2
136136 local tag=$3
137137
138+ local dopt=" --depth 1"
139+
138140 local bopt
139- if [[ -n " $tag " ]]; then
141+ if [[ " $tag " == " --full-depth" ]]; then
142+ dopt=
143+ elif [[ -n " $tag " ]]; then
140144 bopt=" -b $tag "
141145 fi
142146
143- git clone --depth 1 $bopt " ${repo} " " ${odir} " || ERROR 1 " failed to clone git repo: ${repo} "
147+ git clone $dopt $bopt " ${repo} " " ${odir} " || ERROR 1 " failed to clone git repo: ${repo} "
144148 (
145149 cd " ${odir} "
146- git submodule update --init --recursive --depth 1 || ERROR 1 " failed to update git submodule: ${repo} "
150+ git submodule update --init --recursive $dopt || ERROR 1 " failed to update git submodule: ${repo} "
147151 )
148152}
149153
@@ -252,7 +256,7 @@ cmd_clone_run()
252256 git_clone " ${REPO} " " code/${odir} " " ${ALIGNMENT} "
253257 else
254258 type " ${VCS} " _clone > /dev/null 2>&1 || ERROR 1 " no such vcs handler: ${VCS} "
255- " ${VCS} " _clone " ${REPO} " " code/${odir} " &&
259+ " ${VCS} " _clone " ${REPO} " " code/${odir} " --full-depth &&
256260 ( cd " code/${odir} " ;
257261 " ${VCS} " _checkout " ${ALIGNMENT} " ; )
258262 fi
You can’t perform that action at this time.
0 commit comments