Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #40 from sleepyboy/fix_branch_name
Browse files Browse the repository at this point in the history
Support branches containing slash (eg. feature/redesign)
  • Loading branch information
jamiew committed Jun 13, 2014
2 parents d600c45 + 95fa621 commit 936485d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion merge
Expand Up @@ -8,7 +8,7 @@

remote="origin"
branch=$1
current_branch=$(git branch 2>/dev/null|grep -e ^* | tr -d \*//)
current_branch=$(git branch 2>/dev/null|grep -e ^* | tr -d \*)

if [ -z $branch ]; then
echo "Usage: $0 [branchname]"
Expand Down
2 changes: 1 addition & 1 deletion pull
Expand Up @@ -31,7 +31,7 @@ rollback() {
branch=$(git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') || exit $?
default_remote="origin"
remote=$(git config "branch.${branch}.remote" || echo "$default_remote")
remote_branch=$( (git config "branch.${branch}.merge" || echo "refs/heads/$branch") | awk -F '/' '{ print $3 }' )
remote_branch=$( (git config "branch.${branch}.merge" || echo "refs/heads/$branch") | cut -d/ -f3- )

# Stash any local changes
stash=$(git stash)
Expand Down
2 changes: 1 addition & 1 deletion push
Expand Up @@ -18,7 +18,7 @@ color_reset="$(tput sgr0)"
branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') || exit $?
default_remote="origin"
remote=$(git config "branch.${branch}.remote" || echo "$default_remote")
remote_branch=$( (git config "branch.${branch}.merge" || echo "refs/heads/$branch") | awk -F '/' '{ print $3 }' )
remote_branch=$( (git config "branch.${branch}.merge" || echo "refs/heads/$branch") | cut -d/ -f3- )

# Push & save output
push=$(git push --set-upstream $* $remote $remote_branch 2>&1)
Expand Down

0 comments on commit 936485d

Please sign in to comment.