fix: rebuild missing CICD cache objects

This commit is contained in:
Codex
2026-07-02 00:52:24 +00:00
parent 2750834b23
commit 0f8df9fcf3
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -227,6 +227,16 @@ export function runtimeLaneCicdRepoEnsureScript(spec: HwlabRuntimeLaneSpec): str
" git --git-dir=\"$cicd_repo\" config --unset-all remote.origin.partialclonefilter 2>/dev/null || true",
" retry_git fetch-ci-cache-retry --git-dir=\"$cicd_repo\" fetch --depth=1 origin \"+refs/heads/$cicd_branch:refs/remotes/origin/$cicd_branch\" --prune",
"fi",
"if ! git --git-dir=\"$cicd_repo\" cat-file -e \"refs/remotes/origin/$cicd_branch^{commit}\" 2>/dev/null; then",
" echo \"phase=git-ci-cache-rebuild reason=missing-fetched-commit-object\" >&2",
" rm -rf \"$cicd_repo\"",
" retry_git clone-ci-cache-object-retry clone --bare --depth=1 --single-branch --branch \"$cicd_branch\" \"$cicd_url\" \"$cicd_repo\"",
" git --git-dir=\"$cicd_repo\" config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'",
" git --git-dir=\"$cicd_repo\" config --unset-all remote.origin.promisor 2>/dev/null || true",
" git --git-dir=\"$cicd_repo\" config --unset-all remote.origin.partialclonefilter 2>/dev/null || true",
" retry_git fetch-ci-cache-object-retry --git-dir=\"$cicd_repo\" fetch --depth=1 origin \"+refs/heads/$cicd_branch:refs/remotes/origin/$cicd_branch\" --prune",
" git --git-dir=\"$cicd_repo\" cat-file -e \"refs/remotes/origin/$cicd_branch^{commit}\"",
"fi",
].join("\n");
}