Loading bin/git-supertree +11 −12 Original line number Diff line number Diff line Loading @@ -202,15 +202,15 @@ new_worktree() if [[ "$BRANCH" = $(git symbolic-ref HEAD) ]]; then echo "ref: $BRANCH" > "$WT_REPO/HEAD" (cd "$WORKTREE"; git reset --hard) (cd "$WORKTREE"; exec git reset --hard) elif branch_exists "$BRANCH"; then (cd "$WORKTREE"; git checkout $(git for-each-ref "$BRANCH" --format='%(refname:short)') ) (cd "$WORKTREE"; exec git checkout $(git for-each-ref "$BRANCH" --format='%(refname:short)') ) elif [[ -n "$FROM" ]]; then (cd "$WORKTREE"; git checkout -b "$BRANCH" "$FROM") (cd "$WORKTREE"; exec git checkout -b "$BRANCH" "$FROM") elif [[ ${#BRANCH_REMOTES[*]} -eq 1 ]]; then (cd "$WORKTREE"; git checkout -b "$BRANCH" "$BRANCH_REMOTES") (cd "$WORKTREE"; exec git checkout -b "$BRANCH" "$BRANCH_REMOTES") elif branch_exists "${HEAD:=$(git symbolic-ref HEAD)}"; then (cd "$WORKTREE"; git checkout -b "$BRANCH" "$HEAD") (cd "$WORKTREE"; exec git checkout -b "$BRANCH" "$HEAD") else echo "ref: $BRANCH" > "$WT_REPO/HEAD" fi Loading Loading @@ -271,12 +271,11 @@ action_clone() new_repo "${REPOPATH}" ( cd ${REPOPATH} pushd >/dev/null ${REPOPATH} git remote add origin "${URL}" git fetch origin action_add "${BRANCH_NAME}:${BRANCH_PATH}" --from origin/${BRANCH_NAME} ) popd >/dev/null set_head "${REPOPATH}" "${BRANCH_NAME}" } Loading Loading @@ -397,7 +396,7 @@ action_rm() rm -r "$BRANCH" ( cd $(git rev-parse --git-common-dir) git worktree prune exec git worktree prune ) else arg_error "The first argument must be a worktree name" Loading Loading
bin/git-supertree +11 −12 Original line number Diff line number Diff line Loading @@ -202,15 +202,15 @@ new_worktree() if [[ "$BRANCH" = $(git symbolic-ref HEAD) ]]; then echo "ref: $BRANCH" > "$WT_REPO/HEAD" (cd "$WORKTREE"; git reset --hard) (cd "$WORKTREE"; exec git reset --hard) elif branch_exists "$BRANCH"; then (cd "$WORKTREE"; git checkout $(git for-each-ref "$BRANCH" --format='%(refname:short)') ) (cd "$WORKTREE"; exec git checkout $(git for-each-ref "$BRANCH" --format='%(refname:short)') ) elif [[ -n "$FROM" ]]; then (cd "$WORKTREE"; git checkout -b "$BRANCH" "$FROM") (cd "$WORKTREE"; exec git checkout -b "$BRANCH" "$FROM") elif [[ ${#BRANCH_REMOTES[*]} -eq 1 ]]; then (cd "$WORKTREE"; git checkout -b "$BRANCH" "$BRANCH_REMOTES") (cd "$WORKTREE"; exec git checkout -b "$BRANCH" "$BRANCH_REMOTES") elif branch_exists "${HEAD:=$(git symbolic-ref HEAD)}"; then (cd "$WORKTREE"; git checkout -b "$BRANCH" "$HEAD") (cd "$WORKTREE"; exec git checkout -b "$BRANCH" "$HEAD") else echo "ref: $BRANCH" > "$WT_REPO/HEAD" fi Loading Loading @@ -271,12 +271,11 @@ action_clone() new_repo "${REPOPATH}" ( cd ${REPOPATH} pushd >/dev/null ${REPOPATH} git remote add origin "${URL}" git fetch origin action_add "${BRANCH_NAME}:${BRANCH_PATH}" --from origin/${BRANCH_NAME} ) popd >/dev/null set_head "${REPOPATH}" "${BRANCH_NAME}" } Loading Loading @@ -397,7 +396,7 @@ action_rm() rm -r "$BRANCH" ( cd $(git rev-parse --git-common-dir) git worktree prune exec git worktree prune ) else arg_error "The first argument must be a worktree name" Loading