Permalink
Browse files

allow branch name change when not a new issue

  • Loading branch information...
1 parent e42d03f commit 2b3c23e1bd2ede60784cc617a6d536aab1fbc5e7 @sricola committed Apr 24, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 git-open-pull
View
@@ -218,6 +218,14 @@ fi
if [ -z "$FEATURE_BRANCH" ]; then
read -p "enter branch to base pull request on: " FEATURE_BRANCH
+ read -p "rename branch to ${FEATURE_BRANCH}_${ISSUE_NUMBER} [y/n]:" confirm
+ if [ "$confirm" == "y" ] || [ -z "$confirm" ]; then
+ echo "renaming local branch $FEATURE_BRANCH -> ${FEATURE_BRANCH}_${ISSUE_NUMBER}"
+ $GIT_CMD branch -m "${FEATURE_BRANCH}_${ISSUE_NUMBER}" || exit 1
+ echo "pushing branch to $GITHUB_USER"
+ $GIT_CMD push $GITHUB_USER "${FEATURE_BRANCH}_${ISSUE_NUMBER}"
+ FEATURE_BRANCH="${FEATURE_BRANCH}_${ISSUE_NUMBER}"
+ fi
else
read -p "base pull request on [$FEATURE_BRANCH]: " temp
[ -n "$temp" ] && FEATURE_BRANCH=$temp

0 comments on commit 2b3c23e

Please sign in to comment.