File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,22 +199,10 @@ REPO_NAME=$(basename "$GIT_ROOT")
199199# Check if we're in a worktree (not the main checkout)
200200GIT_DIR=$( git -C " $GIT_ROOT " rev-parse --git-dir)
201201if [[ " $GIT_DIR " == * " .git/worktrees/" * ]]; then
202- # We're in a worktree - find the main checkout
202+ # We're in a worktree - find the main checkout and use that for operations
203203 MAIN_CHECKOUT=$( git -C " $GIT_ROOT " rev-parse --path-format=absolute --git-common-dir | sed ' s|/.git$||' )
204-
205- if [[ -n " $TARGET_BRANCH " ]]; then
206- # If branch specified, switch to it from main checkout
207- echo " Currently in a worktree. Switching context to main checkout..."
208- GIT_ROOT=" $MAIN_CHECKOUT "
209- else
210- echo " "
211- gum style --border rounded --padding " 0 1" --border-foreground 214 \
212- " Already in a worktree"
213- echo " "
214- echo " Main checkout: $MAIN_CHECKOUT "
215- echo " Current worktree: $GIT_ROOT "
216- exit 0
217- fi
204+ GIT_ROOT=" $MAIN_CHECKOUT "
205+ REPO_NAME=$( basename " $GIT_ROOT " )
218206fi
219207
220208# Fetch from remote first
You can’t perform that action at this time.
0 commit comments