Added git-refactor

This commit is contained in:
Tj Holowaychuk 2011-04-03 09:30:16 -07:00
parent 9a6324eab8
commit 7d68c2bc7d

12
bin/git-refactor Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
if test "$1" = "finish"; then
test -z $2 && echo "refactor <name> required." && exit 1
branch=refactor/$2
git merge --no-ff $branch && git delete-branch $branch
else
test -z $1 && echo "refactor <name> required." && exit 1
branch=refactor/$1
git checkout -b $branch &> /dev/null
git checkout $branch &> /dev/null
fi