changed the code for git bug|feature|refactor to only accept single argument when not finishing a bug|feature|refactor. This is an easy solution to avoid misspelings of the word 'finish'

This commit is contained in:
zeroDivisible 2013-07-18 14:33:41 +01:00
parent c45e2b8f5f
commit 93d92ae338
3 changed files with 10 additions and 1 deletions

View file

@ -5,7 +5,10 @@ if test "$1" = "finish"; then
branch=bug/$2
git merge --no-ff $branch && git delete-branch $branch
else
test -z $1 && echo "bug <name> required." && exit 1
test -z $1 && echo "bug <name> required." 1>&2 && exit 1
if test -n $2; then
echo "too many arguments; if not finishing a bug, only <name> of new bug is expected" && exit 1
fi
branch=bug/$1
git checkout -b $branch &> /dev/null
fi

View file

@ -6,6 +6,9 @@ if test "$1" = "finish"; then
git merge --no-ff $branch && git delete-branch $branch
else
test -z $1 && echo "feature <name> required." 1>&2 && exit 1
if test -n $2; then
echo "too many arguments; if not finishing a feature, only <name> of new feature is expected" && exit 1
fi
branch=feature/$1
git checkout -b $branch &> /dev/null
fi

View file

@ -6,6 +6,9 @@ if test "$1" = "finish"; then
git merge --no-ff $branch && git delete-branch $branch
else
test -z $1 && echo "refactor <name> required." 1>&2 && exit 1
if test -n $2; then
echo "too many arguments; if not finishing a refactor, only <name> of new refactoring is expected" && exit 1
fi
branch=refactor/$1
git checkout -b $branch &> /dev/null
fi