Skip to content

Commit

Permalink
fix: add SKIP_TAGS_ON_UPDATE flag (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
eti-codefresh authored Sep 4, 2024
1 parent 7b55244 commit cf2be9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion service.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 10.1.28
version: 10.1.29
13 changes: 9 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,15 @@ 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"
git_retry git fetch --tags
if [ -n "$SKIP_TAGS_ON_UPDATE" ]; then
echo "Fetching updates from origin${DEPTH:+ with depth $DEPTH}, skipping tags"
git_retry git fetch origin ${REVISION:+$REVISION} --no-tags ${DEPTH:+ --depth=$DEPTH}
else
echo "Fetching updates from origin"
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*" ${DEPTH:+ --depth=$DEPTH}
fi

git remote set-head origin --auto

if [ -n "$REVISION" ]; then
Expand All @@ -213,7 +218,7 @@ if [ -d "$CLONE_DIR" ]; then

# If the revision is identical to the current branch we can just reset it to the latest changes. This isn't needed when running detached
if [ "$REVISION" == "$CURRENT_BRANCH" ]; then
echo 'Resetting current branch $REVISION to latest changes...'
echo "Resetting current branch $REVISION to latest changes..."
git reset --hard origin/$REVISION
fi
fi
Expand Down

0 comments on commit cf2be9a

Please sign in to comment.