Skip to content

Commit 4c9d023

Browse files
committed
add BUILDKITE_GIT_FETCH_FLAGS
1 parent 6d6d076 commit 4c9d023

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

hooks/checkout

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ if [[ ! -d .git ]]; then
4242
fi
4343

4444
git clean -ffxdq
45-
# fetch branch if commit is HEAD
45+
46+
# fetch branch if commit is HEAD, respecting BUILDKITE_GIT_FETCH_FLAGS if set
47+
FETCH_FLAGS="${BUILDKITE_GIT_FETCH_FLAGS:-}"
4648
if [[ ${BUILDKITE_COMMIT} = "HEAD" ]]; then
47-
git fetch --depth 1 origin "${BUILDKITE_BRANCH}"
49+
git fetch --depth 1 ${FETCH_FLAGS} origin "${BUILDKITE_BRANCH}"
4850
else
49-
git fetch --depth 1 origin "${BUILDKITE_COMMIT}"
51+
git fetch --depth 1 ${FETCH_FLAGS} origin "${BUILDKITE_COMMIT}"
5052
fi
5153

5254
git sparse-checkout set ${NO_CONE_PARAM:+--no-cone} "${CHECKOUT_PATHS[@]}"

0 commit comments

Comments
 (0)