@@ -1960,29 +1960,31 @@ checkout_git_openclaw_ref() {
19601960 return 0
19611961 fi
19621962
1963- run_quiet_step " Fetching requested version" git -C " $repo_dir " fetch --tags origin
1964-
19651963 if [[ " $ref " == " main" ]]; then
1964+ run_quiet_step " Fetching requested version" git -C " $repo_dir " fetch --no-tags origin main
19661965 run_quiet_step " Checking out main" git -C " $repo_dir " checkout main
19671966 if [[ " $GIT_UPDATE " == " 1" ]]; then
1968- run_quiet_step " Updating repository" git -C " $repo_dir " pull --rebase || true
1967+ run_quiet_step " Updating repository" git -C " $repo_dir " pull --rebase --no-tags || true
19691968 fi
19701969 return 0
19711970 fi
19721971
1973- if git -C " $repo_dir " rev-parse --verify --quiet " refs/tags/${ref} ^{commit}" > /dev/null; then
1974- run_quiet_step " Checking out ${ref} " git -C " $repo_dir " checkout --detach " $ref "
1975- return 0
1976- fi
1977-
19781972 if git -C " $repo_dir " ls-remote --exit-code --heads origin " $ref " > /dev/null 2>&1 ; then
1973+ run_quiet_step " Fetching requested version" git -C " $repo_dir " fetch --no-tags origin " refs/heads/${ref} :refs/remotes/origin/${ref} "
19791974 run_quiet_step " Checking out ${ref} " git -C " $repo_dir " checkout -B " $ref " " origin/$ref "
19801975 if [[ " $GIT_UPDATE " == " 1" ]]; then
1981- run_quiet_step " Updating repository" git -C " $repo_dir " pull --rebase || true
1976+ run_quiet_step " Updating repository" git -C " $repo_dir " pull --rebase --no-tags || true
19821977 fi
19831978 return 0
19841979 fi
19851980
1981+ run_quiet_step " Fetching requested version" git -C " $repo_dir " fetch --tags origin
1982+
1983+ if git -C " $repo_dir " rev-parse --verify --quiet " refs/tags/${ref} ^{commit}" > /dev/null; then
1984+ run_quiet_step " Checking out ${ref} " git -C " $repo_dir " checkout --detach " $ref "
1985+ return 0
1986+ fi
1987+
19861988 if git -C " $repo_dir " rev-parse --verify --quiet " ${ref} ^{commit}" > /dev/null; then
19871989 run_quiet_step " Checking out ${ref} " git -C " $repo_dir " checkout --detach " $ref "
19881990 return 0
@@ -1992,6 +1994,18 @@ checkout_git_openclaw_ref() {
19921994 return 1
19931995}
19941996
1997+ git_install_lockfile_flag () {
1998+ local repo_dir=" $1 "
1999+ local ref=" $2 "
2000+
2001+ if [[ " $ref " == " main" ]] || git -C " $repo_dir " ls-remote --exit-code --heads origin " $ref " > /dev/null 2>&1 ; then
2002+ echo " --no-frozen-lockfile"
2003+ return 0
2004+ fi
2005+
2006+ echo " --frozen-lockfile"
2007+ }
2008+
19952009repo_pnpm_spec () {
19962010 local repo_dir=" $1 "
19972011 local package_json=" ${repo_dir} /package.json"
@@ -2368,7 +2382,9 @@ install_openclaw_from_git() {
23682382 cleanup_legacy_submodules " $repo_dir "
23692383 activate_repo_pnpm_version " $repo_dir "
23702384
2371- SHARP_IGNORE_GLOBAL_LIBVIPS=" $SHARP_IGNORE_GLOBAL_LIBVIPS " run_quiet_step " Installing dependencies" run_pnpm -C " $repo_dir " install --frozen-lockfile
2385+ local install_lockfile_flag
2386+ install_lockfile_flag=" $( git_install_lockfile_flag " $repo_dir " " $git_ref " ) "
2387+ 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 "
23722388
23732389 if ! run_quiet_step " Building UI" run_pnpm -C " $repo_dir " ui:build; then
23742390 ui_warn " UI build failed; continuing (CLI may still work)"
0 commit comments