From c119e8d96e2cf38b2149c4424bb2ae4b06f3df53 Mon Sep 17 00:00:00 2001 From: nexxo Date: Sun, 26 Jul 2026 14:48:49 +0200 Subject: [PATCH] fix(deploy): say which branches exist instead of failing inside git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The installer clones BRANCH, which defaults to main — and the repository has no main. Git's own "Remote branch not found" reads like a bad token or an unreachable server, and the branch is the one thing here that is routinely wrong. It now asks first and, when the branch is missing, prints the ones that do exist and how to pass one. Co-Authored-By: Claude Opus 5 --- deploy/install.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deploy/install.sh b/deploy/install.sh index 9456ae6..991bf4c 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -166,6 +166,22 @@ else chown "$APP_USER" "$askpass" trap 'rm -f "$askpass"' EXIT + # Ask what is actually there before cloning. Without this, a BRANCH that + # does not exist fails inside git with "Remote branch not found", which + # reads like a broken token or an unreachable server — and the branch is + # the one thing here that is routinely wrong. + remote_heads="$(GIT_ASKPASS="$askpass" GIT_TERMINAL_PROMPT=0 \ + as_app git ls-remote --heads "${REPO_URL/https:\/\//https://oauth2@}" 2>/dev/null \ + | sed 's|.*refs/heads/||')" \ + || die "Could not reach ${REPO_URL}. Check the server and the token." + + if ! grep -qxF "$BRANCH" <<<"$remote_heads"; then + die "The repository has no branch '${BRANCH}'. It has: +$(sed 's/^/ /' <<<"$remote_heads") + + Pass the one you want: BRANCH= bash install.sh" + fi + GIT_ASKPASS="$askpass" GIT_TERMINAL_PROMPT=0 \ as_app git clone --quiet --branch "$BRANCH" "${REPO_URL/https:\/\//https://oauth2@}" "$INSTALL_DIR"