simplify branch renaming in rename.sh

This commit is contained in:
Olga Bobrova 2014-07-31 14:18:19 -07:00
parent f7b4a74c4c
commit 1369b1bf95
1 changed files with 2 additions and 7 deletions

View File

@ -78,18 +78,13 @@ if [ $ANSWER == "yes" ]; then
sayAndDo git push origin :refs/tags/$OLDNAME
sayAndDo git push --tags
elif [ $TYPE == "branch" ]; then
BOOKMARK=`git rev-parse --abbrev-ref HEAD`
echo "# - saving bookmark for current workspace branch..."
echo "# - renaming..."
sayAndDo git branch -m $OLDNAME $NEWNAME
echo "# - pushing to origin..."
sayAndDo git push --set-upstream origin $NEWNAME
sayAndDo git push origin --delete $OLDNAME
sayAndDo git push origin $NEWNAME
sayAndDo git branch -D $NEWNAME
sayAndDo git checkout -b $NEWNAME --track origin/$NEWNAME
echo "# - restoring workspace branch..."
sayAndDo git checkout $BOOKMARK
fi
cd ../
else
echo "# - better safe than sorry, cancelling..."
fi