officer-setup: the repository URL is https
https://gitea.officer.dev/officerdev/platform.git, not the ssh form. The reachability check is now one test for either scheme: `git ls-remote` with both prompts disabled. That is the real question — not whether the host answers but whether this account can read the repository — and neither prompt fails cleanly on its own. Over https git asks for a username nobody is there to type; over ssh it asks for a password or stops on host-key verification. With GIT_TERMINAL_PROMPT=0 and BatchMode both off, an unreadable repository is an immediate non-zero rather than a hang. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -211,19 +211,16 @@ if ! skip; then
|
||||
|
||||
CLONE_URL="$OFFICER_REPO"
|
||||
|
||||
# Checked before cloning. An ssh URL with no usable key does not fail
|
||||
# cleanly: git prompts for a password nobody is there to type, or stops on
|
||||
# host-key verification.
|
||||
if [[ "$CLONE_URL" == ssh://* ]] && ! repo_ssh_ok "$CLONE_URL"; then
|
||||
# Checked before cloning, for either scheme — see repo_reachable.
|
||||
if ! repo_reachable "$CLONE_URL"; then
|
||||
echo ""
|
||||
warn "${USERNAME} cannot authenticate to $(repo_ssh_host "$CLONE_URL") over ssh"
|
||||
echo " Either add that account's public key to the git server, or clone"
|
||||
echo " over https instead — which works without a key if the repository"
|
||||
echo " is readable anonymously."
|
||||
warn "${USERNAME} cannot read ${CLONE_URL}"
|
||||
echo " Either the host is not answering yet, or the repository is not"
|
||||
echo " readable without credentials."
|
||||
echo ""
|
||||
echo " [1] https — $(repo_https_url "$CLONE_URL")"
|
||||
echo " [2] ssh anyway — will fail if the key is genuinely missing"
|
||||
echo " [3] stop here, and add the key first"
|
||||
echo " [1] try it anyway"
|
||||
echo " [2] use a different URL"
|
||||
echo " [3] stop here"
|
||||
echo ""
|
||||
REPO_PICK=""
|
||||
while [[ -z "$REPO_PICK" ]]; do
|
||||
@@ -232,12 +229,12 @@ if ! skip; then
|
||||
fail "No answer."
|
||||
fi
|
||||
case "${REPO_CHOICE:-1}" in
|
||||
1)
|
||||
CLONE_URL="$(repo_https_url "$CLONE_URL")"
|
||||
1) REPO_PICK=go ;;
|
||||
2)
|
||||
ask_required CLONE_URL "Repository URL" "$CLONE_URL"
|
||||
REPO_PICK=go
|
||||
;;
|
||||
2) REPO_PICK=go ;;
|
||||
3) fail "Stopped. Add ${USERNAME}'s public key to the git server and run this again." ;;
|
||||
3) fail "Stopped. Nothing below can run without the repository." ;;
|
||||
*) warn "Pick 1, 2 or 3." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user