mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user