Skip to content

Commit cf2be9a

Browse files
fix: add SKIP_TAGS_ON_UPDATE flag (#85)
1 parent 7b55244 commit cf2be9a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 10.1.28
1+
version: 10.1.29

start.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,15 @@ 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/*"
202201

203-
echo "Fetching the updates from origin"
204-
git_retry git fetch --tags
202+
if [ -n "$SKIP_TAGS_ON_UPDATE" ]; then
203+
echo "Fetching updates from origin${DEPTH:+ with depth $DEPTH}, skipping tags"
204+
git_retry git fetch origin ${REVISION:+$REVISION} --no-tags ${DEPTH:+ --depth=$DEPTH}
205+
else
206+
echo "Fetching updates from origin"
207+
git_retry git fetch origin --tags --prune "+refs/tags/*:refs/tags/*" ${DEPTH:+ --depth=$DEPTH}
208+
fi
209+
205210
git remote set-head origin --auto
206211

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

214219
# 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
215220
if [ "$REVISION" == "$CURRENT_BRANCH" ]; then
216-
echo 'Resetting current branch $REVISION to latest changes...'
221+
echo "Resetting current branch $REVISION to latest changes..."
217222
git reset --hard origin/$REVISION
218223
fi
219224
fi

0 commit comments

Comments
 (0)