Skip to content

Commit 69073fb

Browse files
authored
Merge pull request #23 from ankushg/ankushg/faster-tags
Add tag_fetch_options to advanced checkout
2 parents 1a9386b + fa5372f commit 69073fb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/commands/checkout.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ steps:
8080
if [ -n "$CIRCLE_TAG" ]
8181
then
8282
# tag
83-
git fetch -t --depth << parameters.fetch_depth >> --force origin "refs/tags/${CIRCLE_TAG}"
83+
git fetch --tags --depth << parameters.fetch_depth >> --force origin "refs/tags/${CIRCLE_TAG}"
8484
elif [[ $(echo $CIRCLE_BRANCH | grep -E ^pull\/[0-9]+$) ]] # sh version of bash `elif [[ "$CIRCLE_BRANCH" =~ ^pull\/[0-9]+$ ]]`
8585
then
8686
# pull request

src/commands/checkout_advanced.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ parameters:
1313
description: >
1414
git fetch options you want to add such as '--depth 1 --verbose' and '--depth 1 --shallow-since "5 days ago"'
1515
you donot beed set '--force' option as it already set by default.
16-
in case of tag, '-t' sat by default either.
16+
in case of tag, '-t' sat by default in tag_fetch_options
17+
tag_fetch_options:
18+
type: string
19+
default: "--tags"
20+
description: >
21+
Additional git fetch options you want to add specifically for tags such as '--tags' or '--no-tags'.
22+
Default value is --tags
1723
keyscan_github:
1824
description: >
1925
Pass `true` to dynamically get ssh-rsa from `github.com`.
@@ -82,7 +88,7 @@ steps:
8288
if [ -n "$CIRCLE_TAG" ]
8389
then
8490
# tag
85-
git fetch -t << parameters.fetch_options >> --force origin "refs/tags/${CIRCLE_TAG}"
91+
git fetch << parameters.tag_fetch_options >> << parameters.fetch_options >> --force origin "+refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
8692
elif [[ $(echo $CIRCLE_BRANCH | grep -e ^pull\/*) ]] # sh version of bash `elif [[ "$CIRCLE_BRANCH" =~ ^pull\/* ]]`
8793
then
8894
# pull request

0 commit comments

Comments
 (0)