[CI][ROCm] Prevent Git maintenance races during shallow fetches (#52810)

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Andreas Karatzas
2026-08-18 15:34:50 -07:00
committed by GitHub
co-authored by OpenAI Codex
parent 203926c477
commit aa6abec49a
2 changed files with 38 additions and 3 deletions
+4 -2
View File
@@ -199,11 +199,13 @@ get_buildkite_target_repo_url() {
git_fetch_with_timeout() {
local timeout_secs="${ROCM_CACHE_GIT_FETCH_TIMEOUT:-60}"
local -a fetch_command=(git fetch --no-auto-maintenance)
# Detached maintenance can race a later shallow fetch on .git/shallow.
if command -v timeout >/dev/null 2>&1; then
timeout "${timeout_secs}s" git fetch "$@"
timeout "${timeout_secs}s" "${fetch_command[@]}" "$@"
else
git fetch "$@"
"${fetch_command[@]}" "$@"
fi
}