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
@@ -423,6 +423,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
git -C "$repo_dir" fetch --no-tags origin "refs/heads/${ref}:refs/remotes/origin/${ref}"
git -C "$repo_dir" checkout -B "$ref" "origin/$ref"
if [[ "$GIT_UPDATE" == "1" ]]; then
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
@@ -430,14 +439,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
git -C "$repo_dir" checkout -B "$ref" "origin/$ref"
if [[ "$GIT_UPDATE" == "1" ]]; then
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
git -C "$repo_dir" checkout --detach "$ref"
return 0