File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
- version : 10.1.19
1
+ version : 10.1.20
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ git_retry () {
25
25
(
26
26
set +e
27
27
RETRY_ON_SIGNAL=128
28
- COMMAND=$@
28
+ COMMAND=( " $@ " ) # Store the command and arguments as an array
29
29
local TRY_NUM=1 MAX_TRIES=4 RETRY_WAIT=5
30
30
until [[ " $TRY_NUM " -ge " $MAX_TRIES " ]]; do
31
- $ COMMAND
31
+ " ${ COMMAND[@]} " # Use "${COMMAND[@]}" to preserve arguments with quotes
32
32
EXIT_CODE=$?
33
33
if [[ $EXIT_CODE == 0 ]]; then
34
34
break
@@ -196,6 +196,10 @@ if [ -d "$CLONE_DIR" ]; then
196
196
cd $CLONE_DIR
197
197
198
198
if [ -n " $REVISION " ]; then
199
+ if [ -n " $DEPTH " ]; then
200
+ git_retry git remote set-branches origin " *"
201
+ git_retry git fetch --depth=$DEPTH
202
+ fi
199
203
git_checkout
200
204
fi
201
205
fi
@@ -205,6 +209,10 @@ else
205
209
eval $GIT_COMMAND
206
210
cd $CLONE_DIR
207
211
if [ -n " $REVISION " ]; then
212
+ if [ -n " $DEPTH " ]; then
213
+ git_retry git remote set-branches origin " *"
214
+ git_retry git fetch --depth=$DEPTH
215
+ fi
208
216
git_checkout
209
217
fi
210
218
You can’t perform that action at this time.
0 commit comments