[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:
co-authored by
OpenAI Codex
parent
203926c477
commit
aa6abec49a
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user