File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -198,21 +198,25 @@ if [ -d "$CLONE_DIR" ]; then
198
198
git clean -df
199
199
git gc --force
200
200
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/*"
207
208
fi
208
209
209
- # Fetch updates using depth only if DEPTH is defined
210
+ echo " Fetching the updates from origin "
210
211
if [ -n " $DEPTH " ]; then
211
- git_retry git fetch origin ${REVISION : + $REVISION } --depth=$DEPTH
212
+ git_retry git fetch --depth=$DEPTH --tags
212
213
else
213
- git_retry git fetch origin ${REVISION : + $REVISION }
214
+ git_retry git fetch --tags
214
215
fi
215
216
217
+
218
+ echo " Fetching the updates from origin"
219
+ git_retry git fetch --tags
216
220
git remote set-head origin --auto
217
221
218
222
if [ -n " $REVISION " ]; then
You can’t perform that action at this time.
0 commit comments