Skip to content

Commit e88e83a

Browse files
committed
Try moving most logic to pre-checkout
1 parent 948dc9c commit e88e83a

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
git sparse-checkout init --cone
4-
git sparse-checkout set .buildkite
3+
# git sparse-checkout init --cone
4+
# git sparse-checkout set .buildkite
55

6-
if [[ -n "${ES_PARTIAL_CHECKOUT_PATHS:-}" ]]; then
7-
git sparse-checkout add "$ES_PARTIAL_CHECKOUT_PATHS"
8-
fi
6+
# if [[ -n "${ES_PARTIAL_CHECKOUT_PATHS:-}" ]]; then
7+
# git sparse-checkout add "$ES_PARTIAL_CHECKOUT_PATHS"
8+
# fi
99

10-
git checkout HEAD
10+
# git checkout HEAD

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,13 @@ chmod +x "$HOME/git-wrapper/git"
1111

1212
export PATH="$HOME/git-wrapper:$PATH"
1313

14+
git init "${BUILDKITE_BUILD_CHECKOUT_PATH}"
15+
git --git-dir "${BUILDKITE_BUILD_CHECKOUT_PATH}/.git" remote add origin "${BUILDKITE_REPO}"
16+
git --git-dir "${BUILDKITE_BUILD_CHECKOUT_PATH}/.git" sparse-checkout init --cone
17+
git --git-dir "${BUILDKITE_BUILD_CHECKOUT_PATH}/.git" sparse-checkout set .buildkite
18+
if [[ -n "${ES_PARTIAL_CHECKOUT_PATHS:-}" ]]; then
19+
git --git-dir "${BUILDKITE_BUILD_CHECKOUT_PATH}/.git" sparse-checkout add "$ES_PARTIAL_CHECKOUT_PATHS"
20+
fi
21+
1422
export BUILDKITE_GIT_CLONE_FLAGS="-v --filter=blob:none --no-checkout --depth=1 --sparse"
15-
export BUILDKITE_GIT_FETCH_FLAGS="-v --update-shallow"
23+
export BUILDKITE_GIT_FETCH_FLAGS="-v --update-shallow --depth 1"

0 commit comments

Comments
 (0)