Skip to content

Commit e3081ab

Browse files
committed
Skip clean also
1 parent 73b25af commit e3081ab

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.buildkite/scripts/run-agents/hooks/post-checkout

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
# fi
99

1010
# git checkout HEAD
11+
12+
export SKIP_GIT_WRAPPER=true

.buildkite/scripts/run-agents/hooks/pre-checkout

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ mkdir -p "$HOME/git-wrapper"
99
cat << 'EOF' > "$HOME/git-wrapper/git"
1010
#!/bin/bash
1111
12-
if [[ "${1:-}" == "submodule" || "${1:-}" == "clone" ]]; then exit 0; fi
12+
if [[ -z "${SKIP_GIT_WRAPPER:-}" ]]; then
13+
if [[ "${1:-}" == "submodule" || "${1:-}" == "clone" || "${1:-}" == "clean" ]]; then exit 0; fi
14+
fi
1315
1416
"$ES_ORIGINAL_GIT_BINARY" "${@}"
1517
EOF
@@ -18,6 +20,7 @@ chmod +x "$HOME/git-wrapper/git"
1820

1921
export PATH="$HOME/git-wrapper:$PATH"
2022

23+
rm -rf "${BUILDKITE_BUILD_CHECKOUT_PATH}"
2124
git init "${BUILDKITE_BUILD_CHECKOUT_PATH}"
2225
git --git-dir "${BUILDKITE_BUILD_CHECKOUT_PATH}/.git" remote add origin "${BUILDKITE_REPO}"
2326
git --git-dir "${BUILDKITE_BUILD_CHECKOUT_PATH}/.git" sparse-checkout init --cone

0 commit comments

Comments
 (0)