Skip to content

Commit ccebd4a

Browse files
committed
test3
1 parent 59fd3e7 commit ccebd4a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

start.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,21 +198,25 @@ 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/*"
202-
203-
echo "Fetching the updates from origin"
204-
# Set remote branches only if REVISION is defined
205-
if [ -n "$REVISION" ]; then
206-
git_retry git remote set-branches origin "$REVISION"
201+
# Check if DEPTH is set (and non-zero) to decide on the fetch strategy
202+
if [ -n "$DEPTH" ]; then
203+
echo "Fetching updates with depth $DEPTH"
204+
git_retry git fetch --depth=$DEPTH origin --tags --prune "+refs/tags/*:refs/tags/*"
205+
else
206+
echo "Fetching full updates"
207+
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*"
207208
fi
208209

209-
# Fetch updates using depth only if DEPTH is defined
210+
echo "Fetching the updates from origin"
210211
if [ -n "$DEPTH" ]; then
211-
git_retry git fetch origin ${REVISION:+$REVISION} --depth=$DEPTH
212+
git_retry git fetch --depth=$DEPTH --tags
212213
else
213-
git_retry git fetch origin ${REVISION:+$REVISION}
214+
git_retry git fetch --tags
214215
fi
215216

217+
218+
echo "Fetching the updates from origin"
219+
git_retry git fetch --tags
216220
git remote set-head origin --auto
217221

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

0 commit comments

Comments
 (0)