Skip to content

Commit c050c4d

Browse files
committed
fix shellcheck error
1 parent d9dd41a commit c050c4d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

hooks/checkout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ git clean -ffxdq
4646
# fetch branch if commit is HEAD, respecting BUILDKITE_GIT_FETCH_FLAGS if set
4747
FETCH_FLAGS="${BUILDKITE_GIT_FETCH_FLAGS:-}"
4848
if [[ ${BUILDKITE_COMMIT} = "HEAD" ]]; then
49-
git fetch --depth 1 ${FETCH_FLAGS} origin "${BUILDKITE_BRANCH}"
49+
git fetch --depth 1 "${FETCH_FLAGS}" origin "${BUILDKITE_BRANCH}"
5050
else
51-
git fetch --depth 1 ${FETCH_FLAGS} origin "${BUILDKITE_COMMIT}"
51+
git fetch --depth 1 "${FETCH_FLAGS}" origin "${BUILDKITE_COMMIT}"
5252
fi
5353

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

tests/checkout.bats

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ setup() {
8585
export BUILDKITE_GIT_FETCH_FLAGS="--prune --verbose"
8686
export BUILDKITE_COMMIT="HEAD"
8787
export BUILDKITE_BRANCH="main"
88+
89+
stub ssh-keyscan "* : echo 'keyscan'"
8890
stub git "clean * : echo 'git clean'"
8991
stub git "fetch --depth 1 --prune --verbose origin * : echo 'git fetch with flags'"
9092
stub git "sparse-checkout set * * : echo 'git sparse-checkout'"
@@ -95,5 +97,6 @@ setup() {
9597
assert_success
9698
assert_output --partial 'git fetch with flags'
9799

100+
unstub ssh-keyscan
98101
unstub git
99102
}

0 commit comments

Comments
 (0)