From f4955bee9da0c137e1939b97642a7ba64eaf8e01 Mon Sep 17 00:00:00 2001 From: Joshua Oosthuizen Date: Tue, 17 Nov 2026 19:08:53 +0200 Subject: [PATCH] Fetch tags with --force: the release tag on the server wins Found in the VM test: when a tag had moved (a re-tagged release), a church's fetch refused it and every later deploy failed its checks. The deploy checks out the tag the Hub asked for, so the remote's tag is the one to trust. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Ls1vMdni7EfytGYqQTprME --- scripts/lib/deploy.sh | 2 +- scripts/lib/install.sh | 2 +- scripts/lib/status.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lib/deploy.sh b/scripts/lib/deploy.sh index 6569756..44d8b28 100644 --- a/scripts/lib/deploy.sh +++ b/scripts/lib/deploy.sh @@ -133,7 +133,7 @@ deploy_church() { if [ -z "$dir" ] || [ ! -d "$dir/.git" ]; then warn "$p: $dir isn't a checkout (church.env $(upper "$p")_DIR)."; failed=1; continue; fi if [ -z "$user" ] || ! id "$user" >/dev/null 2>&1; then warn "$p: no app user \"$user\" (church.env $(upper "$p")_USER)."; failed=1; continue; fi DIR[$p]="$dir"; USR[$p]="$user" - if ! run_as "$user" "$dir" git fetch --tags --quiet origin; then + if ! run_as "$user" "$dir" git fetch --tags --force --quiet origin; then warn "$p: couldn't fetch from origin."; failed=1; continue fi PREV[$p]="$(checkout_ref "$dir" "$p")" diff --git a/scripts/lib/install.sh b/scripts/lib/install.sh index 312b145..6873e4f 100644 --- a/scripts/lib/install.sh +++ b/scripts/lib/install.sh @@ -217,7 +217,7 @@ install_events() { mkdir -p "$dir" chown "$user:$user" "$dir" run_as "$user" "$dir" git clone --quiet "$CROSSCODE_REPO" . - run_as "$user" "$dir" git fetch --tags --quiet origin + run_as "$user" "$dir" git fetch --tags --force --quiet origin if [ "$main" = 1 ]; then version=origin/main elif [ -z "$version" ]; then diff --git a/scripts/lib/status.sh b/scripts/lib/status.sh index df5da38..ba04019 100644 --- a/scripts/lib/status.sh +++ b/scripts/lib/status.sh @@ -56,7 +56,7 @@ status_church() { continue fi if [ "$fetch" = 1 ]; then - run_as "$user" "$dir" timeout 20 git fetch --tags --quiet origin 2>/dev/null || true + run_as "$user" "$dir" timeout 20 git fetch --tags --force --quiet origin 2>/dev/null || true fi ref="$(checkout_ref "$dir" "$p")" latest="$(latest_tag "$dir" "$p")"