diff --git a/service.yaml b/service.yaml index e7bf1a0..9bd68bc 100644 --- a/service.yaml +++ b/service.yaml @@ -1 +1 @@ -version: 10.1.19 +version: 10.1.20 diff --git a/start.sh b/start.sh index 9941ecf..91d5a20 100644 --- a/start.sh +++ b/start.sh @@ -25,10 +25,10 @@ git_retry () { ( set +e RETRY_ON_SIGNAL=128 - COMMAND=$@ + COMMAND=("$@") # Store the command and arguments as an array local TRY_NUM=1 MAX_TRIES=4 RETRY_WAIT=5 until [[ "$TRY_NUM" -ge "$MAX_TRIES" ]]; do - $COMMAND + "${COMMAND[@]}" # Use "${COMMAND[@]}" to preserve arguments with quotes EXIT_CODE=$? if [[ $EXIT_CODE == 0 ]]; then break @@ -196,6 +196,10 @@ if [ -d "$CLONE_DIR" ]; then cd $CLONE_DIR if [ -n "$REVISION" ]; then + if [ -n "$DEPTH" ]; then + git_retry git remote set-branches origin "*" + git_retry git fetch --depth=$DEPTH + fi git_checkout fi fi @@ -205,6 +209,10 @@ else eval $GIT_COMMAND cd $CLONE_DIR if [ -n "$REVISION" ]; then + if [ -n "$DEPTH" ]; then + git_retry git remote set-branches origin "*" + git_retry git fetch --depth=$DEPTH + fi git_checkout fi