cd "$(git rev-parse --show-toplevel)" || return
# Skip if rebase is in progress.
- if [[ -e .git/rebase-merge/interactive ]] ; then
+ if [[ -e $(git rev-parse --git-path rebase-merge) || \
+ -e $(git rev-parse --git-path rebase-apply) ]] ; then
printf "${BAD}skipping due to active rebase${NORMAL}\n"
exit 1
fi
branches=( $(git for-each-ref --format='%(refname:short)' 'refs/heads/*') )
for b in "${branches[@]}" ; do
- rb_one "${b}" "${opts[@]}"
+ # If it's a branch in another worktree, ignore it.
+ if [[ $(git branch --list "${b}") != "+"* ]] ; then
+ rb_one "${b}" "${opts[@]}"
+ fi
done
git checkout -q "${orig}"