We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d6d076 commit 4c9d023Copy full SHA for 4c9d023
1 file changed
hooks/checkout
@@ -42,11 +42,13 @@ if [[ ! -d .git ]]; then
42
fi
43
44
git clean -ffxdq
45
-# fetch branch if commit is HEAD
+
46
+# fetch branch if commit is HEAD, respecting BUILDKITE_GIT_FETCH_FLAGS if set
47
+FETCH_FLAGS="${BUILDKITE_GIT_FETCH_FLAGS:-}"
48
if [[ ${BUILDKITE_COMMIT} = "HEAD" ]]; then
- git fetch --depth 1 origin "${BUILDKITE_BRANCH}"
49
+ git fetch --depth 1 ${FETCH_FLAGS} origin "${BUILDKITE_BRANCH}"
50
else
- git fetch --depth 1 origin "${BUILDKITE_COMMIT}"
51
+ git fetch --depth 1 ${FETCH_FLAGS} origin "${BUILDKITE_COMMIT}"
52
53
54
git sparse-checkout set ${NO_CONE_PARAM:+--no-cone} "${CHECKOUT_PATHS[@]}"
0 commit comments