echo " -> skipping due to missing merge branch"
else
echo
- git checkout -q "${b}" || exit
+ git checkout -q "${b}" || return
if ! git rebase ; then
git rebase --abort
fi
usage
fi
+ # Switch to the top dir in case the working dir doesn't exist in every branch.
+ cd "$(git rev-parse --show-toplevel)" || return
+
local orig b branches
orig=$(git rev-parse --abbrev-ref HEAD) || return
- branches=( $(git ls-remote . 'heads/*' | sed 's:.*refs/heads/::') )
+ branches=( $(git ls-remote --heads . | sed 's:.*refs/heads/::') )
for b in "${branches[@]}" ; do
rb_one "${b}"
done