Skip to content

Commit 59fd3e7

Browse files
committed
test2
1 parent ea61ac2 commit 59fd3e7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

start.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,21 @@ if [ -d "$CLONE_DIR" ]; then
198198
git clean -df
199199
git gc --force
200200
git_retry git remote prune origin
201-
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*" --depth=$DEPTH
201+
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*"
202202

203203
echo "Fetching the updates from origin"
204-
git_retry git fetch --tags --depth=$DEPTH
204+
# Set remote branches only if REVISION is defined
205+
if [ -n "$REVISION" ]; then
206+
git_retry git remote set-branches origin "$REVISION"
207+
fi
208+
209+
# Fetch updates using depth only if DEPTH is defined
210+
if [ -n "$DEPTH" ]; then
211+
git_retry git fetch origin ${REVISION:+$REVISION} --depth=$DEPTH
212+
else
213+
git_retry git fetch origin ${REVISION:+$REVISION}
214+
fi
215+
205216
git remote set-head origin --auto
206217

207218
if [ -n "$REVISION" ]; then

0 commit comments

Comments
 (0)