From cbea5f198fbe338850ba6155fdfe7bf905ae2029 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Sep 2025 15:34:28 -0700 Subject: [PATCH] op.sh: more robust switch for submodules --- tools/op.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/op.sh b/tools/op.sh index 54ff8e97e9..ae12809eb9 100755 --- a/tools/op.sh +++ b/tools/op.sh @@ -366,9 +366,11 @@ function op_switch() { BRANCH="$1" git config --replace-all remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + git submodule deinit --all --force git fetch "$REMOTE" "$BRANCH" git checkout -f FETCH_HEAD git checkout -B "$BRANCH" --track "$REMOTE"/"$BRANCH" + git submodule deinit --all --force git reset --hard "${REMOTE}/${BRANCH}" git clean -df git submodule update --init --recursive