fix: scope git installer lockfile refresh

This commit is contained in:
Keshav's Bot
2026-05-15 00:24:06 +05:30
committed by Peter Steinberger
parent 36411cde8f
commit b26dcb3390
4 changed files with 86 additions and 9 deletions

View File

@@ -414,16 +414,17 @@ checkout_git_openclaw_ref() {
return 0
fi
git -C "$repo_dir" fetch --tags origin
if [[ "$ref" == "main" ]]; then
git -C "$repo_dir" fetch --no-tags origin main
git -C "$repo_dir" checkout main
if [[ "$GIT_UPDATE" == "1" ]]; then
git -C "$repo_dir" pull --rebase || true
git -C "$repo_dir" pull --rebase --no-tags || true
fi
return 0
fi
git -C "$repo_dir" fetch --tags origin
if git -C "$repo_dir" rev-parse --verify --quiet "refs/tags/${ref}^{commit}" >/dev/null; then
git -C "$repo_dir" checkout --detach "$ref"
return 0
@@ -445,6 +446,18 @@ checkout_git_openclaw_ref() {
fail "Requested git version not found: ${ref}"
}
git_install_lockfile_flag() {
local repo_dir="$1"
local ref="$2"
if [[ "$ref" == "main" ]] || git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
echo "--no-frozen-lockfile"
return 0
fi
echo "--frozen-lockfile"
}
repo_pnpm_spec() {
local repo_dir="$1"
local package_json="${repo_dir}/package.json"
@@ -723,7 +736,9 @@ install_openclaw_from_git() {
ensure_pnpm_git_prepare_allowlist "$repo_dir"
activate_repo_pnpm_version "$repo_dir"
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_pnpm -C "$repo_dir" install --frozen-lockfile
local install_lockfile_flag
install_lockfile_flag="$(git_install_lockfile_flag "$repo_dir" "$git_ref")"
CI="${CI:-true}" SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_pnpm -C "$repo_dir" install "$install_lockfile_flag"
if ! run_pnpm -C "$repo_dir" ui:build; then
log "UI build failed; continuing (CLI may still work)"

View File

@@ -1993,6 +1993,18 @@ checkout_git_openclaw_ref() {
return 1
}
git_install_lockfile_flag() {
local repo_dir="$1"
local ref="$2"
if [[ "$ref" == "main" ]] || git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
echo "--no-frozen-lockfile"
return 0
fi
echo "--frozen-lockfile"
}
repo_pnpm_spec() {
local repo_dir="$1"
local package_json="${repo_dir}/package.json"
@@ -2369,7 +2381,9 @@ install_openclaw_from_git() {
cleanup_legacy_submodules "$repo_dir"
activate_repo_pnpm_version "$repo_dir"
CI="${CI:-true}" SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_quiet_step "Installing dependencies" run_pnpm -C "$repo_dir" install --no-frozen-lockfile
local install_lockfile_flag
install_lockfile_flag="$(git_install_lockfile_flag "$repo_dir" "$git_ref")"
CI="${CI:-true}" SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_quiet_step "Installing dependencies" run_pnpm -C "$repo_dir" install "$install_lockfile_flag"
if ! run_quiet_step "Building UI" run_pnpm -C "$repo_dir" ui:build; then
ui_warn "UI build failed; continuing (CLI may still work)"