File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ options::description "Switch all of the the branch of all of the target\
2828options::add -o c -d " client repository set" -a -e CLIENT
2929options::add -o o -d " target organization" -a -m -e ORG
3030options::add -o b -d " branch to switch to" -a -m -e BRANCH
31+ options::add -o n -d " if this is a new branch" -x NEW_BRANCH
3132options::parse " $@ "
3233shift $(( OPTIND - 1 ))
3334
@@ -45,7 +46,10 @@ for d in "$TARGET_DIR"/*; do
4546 log::warn " Cannot cd to $d "
4647 continue
4748 fi
48- if exec::hide git::cmd checkout -b " $BRANCH " " $@ " ; then
49+ if [ " $NEW_BRANCH " = " true" ] && exec::hide git::cmd checkout -b \
50+ " $BRANCH " " $@ " ; then
51+ log::info " Checked out into new branch $BRANCH in $d "
52+ elif exec::hide git::cmd checkout " $BRANCH " " $@ " ; then
4953 log::info " Checked out $BRANCH in $d "
5054 else
5155 log::warn " Failed to checkout branch $BRANCH in $d "
You can’t perform that action at this time.
0 commit comments