fix: fetch git installer branch refs without tags

This commit is contained in:
Peter Steinberger
2026-05-15 04:08:56 +01:00
parent b26dcb3390
commit a9aafc84b1
4 changed files with 38 additions and 18 deletions
+9 -8
View File
@@ -1969,6 +1969,15 @@ checkout_git_openclaw_ref() {
return 0
fi
if git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
run_quiet_step "Fetching requested version" git -C "$repo_dir" fetch --no-tags origin "refs/heads/${ref}:refs/remotes/origin/${ref}"
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout -B "$ref" "origin/$ref"
if [[ "$GIT_UPDATE" == "1" ]]; then
run_quiet_step "Updating repository" git -C "$repo_dir" pull --rebase --no-tags || true
fi
return 0
fi
run_quiet_step "Fetching requested version" git -C "$repo_dir" fetch --tags origin
if git -C "$repo_dir" rev-parse --verify --quiet "refs/tags/${ref}^{commit}" >/dev/null; then
@@ -1976,14 +1985,6 @@ checkout_git_openclaw_ref() {
return 0
fi
if git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout -B "$ref" "origin/$ref"
if [[ "$GIT_UPDATE" == "1" ]]; then
run_quiet_step "Updating repository" git -C "$repo_dir" pull --rebase || true
fi
return 0
fi
if git -C "$repo_dir" rev-parse --verify --quiet "${ref}^{commit}" >/dev/null; then
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout --detach "$ref"
return 0