[CI][AMD] Allow git operations on previously created work trees (#47554)

Signed-off-by: Tres Popp <tres.popp@amd.com>

Tres committed Jul 3, 2026 at 21:41 UTC f006e5a24cb38b88745cc45e1ee520a83e03c692
1 file changed +4 -2
.buildkite/scripts/hardware_ci/run-amd-test.sh
+4 -2
@@ -448,9 +448,11 @@ checkout="${BUILDKITE_BUILD_CHECKOUT_PATH:-}"
448 if [[ -z "${checkout}" || ! -d "${checkout}" ]]; then
449 checkout="."
450 fi
451 -if git -C "${checkout}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
451 +# Pass safe.directory per-command (-c) because buildkite runs will always fail
452 +# the next check on git 2.35.2+ due to mixed uses of root and buildkite-agent/uids.
453 +if git -c "safe.directory=${checkout}" -C "${checkout}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
454 vllm_standalone_merge_base="$(
453 - git -C "${checkout}" merge-base HEAD origin/main 2>/dev/null || true
455 + git -c "safe.directory=${checkout}" -C "${checkout}" merge-base HEAD origin/main 2>/dev/null || true
456 )"
457 fi
458 if [[ -z "${vllm_standalone_merge_base}" ]]; then