Changeset aedc00d in Klonkt for scripts/install.sh
- Timestamp:
- 06/29/2026 11:48:17 PM (2 months ago)
- Branches:
- main
- Children:
- f882048
- Parents:
- 1273101
- File:
-
- 1 edited
-
scripts/install.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
scripts/install.sh
r1273101 raedc00d 142 142 git -C "$KLONKT_DIR" remote set-url origin "$KLONKT_REPO" 143 143 git -C "$KLONKT_DIR" fetch --depth 1 origin "$KLONKT_BRANCH" 144 # Reset to FETCH_HEAD, not origin/$KLONKT_BRANCH: a single-branch/shallow clone (or one 145 # originally on a different branch, e.g. main → stable) has no origin/<branch> tracking ref, 146 # so `reset --hard origin/stable` fails with "ambiguous argument". FETCH_HEAD always points 147 # at what we just fetched, regardless of refspec or which branch the clone started on. 148 git -C "$KLONKT_DIR" reset --hard FETCH_HEAD 144 # Check out FETCH_HEAD AS the target branch — not `reset --hard origin/$KLONKT_BRANCH` 145 # (a single-branch/shallow clone, or one that started on a different branch like main, 146 # has no origin/<branch> ref → "ambiguous argument 'origin/stable'"), and not a plain 147 # `reset --hard FETCH_HEAD` (that would leave the OLD local branch, e.g. main, pointing at 148 # a stable commit → `git status` reports it as diverged from origin/main). `checkout -f -B` 149 # makes the local branch BE $KLONKT_BRANCH at the fetched tip: robust, forced, no divergence. 150 git -C "$KLONKT_DIR" checkout -qf -B "$KLONKT_BRANCH" FETCH_HEAD 149 151 else 150 152 [ -e "$KLONKT_DIR" ] && [ -n "$(ls -A "$KLONKT_DIR" 2>/dev/null)" ] && die "$KLONKT_DIR already exists and is not a git checkout. Pick --dir, or clean it up." … … 240 242 B=\$(runuser -u ${KLONKT_USER} -- git -C "\$D" rev-parse HEAD 2>/dev/null || true) 241 243 runuser -u ${KLONKT_USER} -- git -C "\$D" fetch --depth 1 origin ${KLONKT_BRANCH} 242 runuser -u ${KLONKT_USER} -- git -C "\$D" reset --hardFETCH_HEAD244 runuser -u ${KLONKT_USER} -- git -C "\$D" checkout -qf -B ${KLONKT_BRANCH} FETCH_HEAD 243 245 A=\$(runuser -u ${KLONKT_USER} -- git -C "\$D" rev-parse HEAD) 244 246 if [ "\$B" = "\$A" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)