Force build checkout to remote branch

This commit is contained in:
root
2026-05-03 10:18:29 +00:00
parent 3317191540
commit 4098527982
+3 -3
View File
@@ -482,9 +482,9 @@ ensure_repo() {
if [[ -d "$WORKDIR/.git" ]]; then if [[ -d "$WORKDIR/.git" ]]; then
ROOT="$WORKDIR" ROOT="$WORKDIR"
run_step 25 "Fetching existing Agrarian checkout" git -C "$ROOT" fetch origin "$BRANCH" run_step 25 "Fetching existing Agrarian checkout" git -C "$ROOT" fetch origin "$BRANCH"
run_step 27 "Resetting local checkout files" git -C "$ROOT" reset --hard HEAD run_step 30 "Checking out $BRANCH" git -C "$ROOT" checkout -B "$BRANCH" "origin/$BRANCH"
run_step 30 "Checking out $BRANCH" git -C "$ROOT" checkout "$BRANCH" run_step 35 "Resetting checkout to origin/$BRANCH" git -C "$ROOT" reset --hard "origin/$BRANCH"
run_step 35 "Fast-forwarding $BRANCH" git -C "$ROOT" pull --ff-only origin "$BRANCH" run_step 37 "Removing local untracked checkout files" git -C "$ROOT" clean -fd
else else
mkdir -p "$(dirname "$WORKDIR")" mkdir -p "$(dirname "$WORKDIR")"
run_step 35 "Cloning Agrarian into $WORKDIR" git clone --branch "$BRANCH" "$REPO_URL" "$WORKDIR" run_step 35 "Cloning Agrarian into $WORKDIR" git clone --branch "$BRANCH" "$REPO_URL" "$WORKDIR"