Skip to content

Commit

Permalink
test3
Browse files Browse the repository at this point in the history
  • Loading branch information
eti-codefresh committed Aug 29, 2024
1 parent 59fd3e7 commit ccebd4a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,25 @@ if [ -d "$CLONE_DIR" ]; then
git clean -df
git gc --force
git_retry git remote prune origin
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*"

echo "Fetching the updates from origin"
# Set remote branches only if REVISION is defined
if [ -n "$REVISION" ]; then
git_retry git remote set-branches origin "$REVISION"
# Check if DEPTH is set (and non-zero) to decide on the fetch strategy
if [ -n "$DEPTH" ]; then
echo "Fetching updates with depth $DEPTH"
git_retry git fetch --depth=$DEPTH origin --tags --prune "+refs/tags/*:refs/tags/*"
else
echo "Fetching full updates"
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*"
fi

# Fetch updates using depth only if DEPTH is defined
echo "Fetching the updates from origin"
if [ -n "$DEPTH" ]; then
git_retry git fetch origin ${REVISION:+$REVISION} --depth=$DEPTH
git_retry git fetch --depth=$DEPTH --tags
else
git_retry git fetch origin ${REVISION:+$REVISION}
git_retry git fetch --tags
fi


echo "Fetching the updates from origin"
git_retry git fetch --tags
git remote set-head origin --auto

if [ -n "$REVISION" ]; then
Expand Down

0 comments on commit ccebd4a

Please sign in to comment.