File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -198,10 +198,21 @@ 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/*" --depth= $DEPTH
201
+ git_retry git fetch origin --tags --prune " +refs/tags/*:refs/tags/*"
202
202
203
203
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
+
205
216
git remote set-head origin --auto
206
217
207
218
if [ -n " $REVISION " ]; then
You can’t perform that action at this time.
0 commit comments