fix(install): reject commit-less git checkouts (#113809)

* fix(install): reject commit-less git checkouts

* test(install): fix incomplete-checkout coverage

* fix(install): pin incomplete checkout validation

* test(install): update pinned checkout stub

* fix(install): require checkout HEAD commit object
This commit is contained in:
ooiuuii
2026-08-02 23:05:42 +08:00
committed by GitHub
parent c1e31f1784
commit 807506381a
6 changed files with 122 additions and 0 deletions
+5
View File
@@ -1186,6 +1186,11 @@ install_openclaw_from_git() {
ensure_pnpm
ensure_pnpm_binary_for_scripts
if [[ -d "$repo_dir/.git" ]] &&
! git --git-dir="$repo_dir/.git" --work-tree="$repo_dir" rev-parse --verify --quiet 'HEAD^{commit}' >/dev/null 2>&1; then
fail "Git checkout has no commit: ${repo_dir}. Move or remove this incomplete checkout, then retry."
fi
if [[ -d "$repo_dir/.git" ]]; then
:
elif [[ -d "$repo_dir" ]]; then