remove duplicate checkout

This commit is contained in:
spacewander 2015-09-08 16:08:50 +08:00
parent bb4acf0757
commit a7f830b1e7
4 changed files with 4 additions and 9 deletions

View file

@ -10,6 +10,5 @@ else
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
test -n $? && git checkout $branch &> /dev/null
git checkout -b $branch
fi

3
bin/git-chore Normal file → Executable file
View file

@ -10,6 +10,5 @@ else
echo "too many arguments; if not finishing a chore, only <name> of new chore is expected" && exit 1
fi
branch=chore/$1
git checkout -b $branch &> /dev/null
test -n $? && git checkout $branch &> /dev/null
git checkout -b $branch
fi

View file

@ -20,6 +20,5 @@ else
else
branch=feature/$1
fi
git checkout -b $branch &> /dev/null
test -n $? && git checkout $branch &> /dev/null
git checkout -b $branch
fi

View file

@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Removed unnecessary git checkout for bug, feature and refactor
if test "$1" = "finish"; then
test -z $2 && echo "refactor <name> required." 1>&2 && exit 1
@ -11,6 +10,5 @@ else
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
test -n $? && git checkout $branch &> /dev/null
git checkout -b $branch
fi