Permalink
Browse files

Support more -m patterns

  • Loading branch information...
1 parent 4f08111 commit 7f280ccbc465749ab0ebe3f8281053b151c91960 @lennartcl committed Nov 20, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 git-branch-from-cherry
View
@@ -73,9 +73,9 @@ fi
# -m is very conservative and only supports a few cases
if [ "$MOVE_BRANCH" ]; then
- if echo "$*" | grep -Ei '^HEAD (HEAD\^|HEAD~1) (HEAD\^\^|HEAD~2)$' >/dev/null; then
+ if echo "$*" | grep -Ei '^ (HEAD\^\^|HEAD~2) (HEAD\^|HEAD~1) HEAD$' >/dev/null; then
MOVE_BRANCH="git reset --hard HEAD^^^"
- elif echo "$*" | grep -Ei '^HEAD (HEAD\^|HEAD~1)$' >/dev/null; then
+ elif echo "$*" | grep -Ei '^(HEAD\^|HEAD~1) HEAD$' >/dev/null; then
MOVE_BRANCH="git reset --hard HEAD^^"
elif echo "$*" | grep -Ei '^HEAD$' >/dev/null || [ "`git rev-parse $*`" == "`git rev-parse HEAD`" ] ||
[ "$*" == "" ]; then

0 comments on commit 7f280cc

Please sign in to comment.