fix: make git clone fallback explicitly use main branch
The releases API returns 404 when no releases exist, causing the installer to fall back to 'main'. However, the fallback clone was not explicitly specifying a branch, which could cause issues if the repository's default branch configuration is in an inconsistent state. Now the fallback clone also explicitly uses --branch main to ensure consistent behavior.
This commit is contained in:
+3
-1
@@ -182,9 +182,11 @@ if ! step_done "source"; then
|
||||
git -C "$SRC_DIR" fetch --tags --quiet
|
||||
git -C "$SRC_DIR" checkout "$LATEST_TAG" --quiet
|
||||
else
|
||||
# Try with explicit branch first, then fallback to explicit 'main' branch
|
||||
git clone --depth 1 --branch "$LATEST_TAG" \
|
||||
"https://github.com/${GITHUB_REPO}.git" "$SRC_DIR" 2>/dev/null \
|
||||
|| git clone --depth 1 "https://github.com/${GITHUB_REPO}.git" "$SRC_DIR"
|
||||
|| git clone --depth 1 --branch main \
|
||||
"https://github.com/${GITHUB_REPO}.git" "$SRC_DIR"
|
||||
fi
|
||||
mark_done "source"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user