Skip to content

Commit d9dd41a

Browse files
committed
add tests for BUILDKITE_GIT_FETCH_FLAGS
1 parent 4c9d023 commit d9dd41a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/checkout.bats

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,20 @@ setup() {
8080

8181
unstub git
8282
}
83+
84+
@test "Respects BUILDKITE_GIT_FETCH_FLAGS in git fetch" {
85+
export BUILDKITE_GIT_FETCH_FLAGS="--prune --verbose"
86+
export BUILDKITE_COMMIT="HEAD"
87+
export BUILDKITE_BRANCH="main"
88+
stub git "clean * : echo 'git clean'"
89+
stub git "fetch --depth 1 --prune --verbose origin * : echo 'git fetch with flags'"
90+
stub git "sparse-checkout set * * : echo 'git sparse-checkout'"
91+
stub git "checkout * : echo 'checkout'"
92+
93+
run "$PWD"/hooks/checkout
94+
95+
assert_success
96+
assert_output --partial 'git fetch with flags'
97+
98+
unstub git
99+
}

0 commit comments

Comments
 (0)