From a7f830b1e7bbc25d6d5a9f29e67b3da73a9d2567 Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 8 Sep 2015 16:08:50 +0800 Subject: [PATCH] remove duplicate checkout --- bin/git-bug | 3 +-- bin/git-chore | 3 +-- bin/git-feature | 3 +-- bin/git-refactor | 4 +--- 4 files changed, 4 insertions(+), 9 deletions(-) mode change 100644 => 100755 bin/git-chore diff --git a/bin/git-bug b/bin/git-bug index 37174e2..b748600 100755 --- a/bin/git-bug +++ b/bin/git-bug @@ -10,6 +10,5 @@ else echo "too many arguments; if not finishing a bug, only 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 diff --git a/bin/git-chore b/bin/git-chore old mode 100644 new mode 100755 index d4030f8..47ac0a5 --- a/bin/git-chore +++ b/bin/git-chore @@ -10,6 +10,5 @@ else echo "too many arguments; if not finishing a chore, only 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 diff --git a/bin/git-feature b/bin/git-feature index 9d105a1..5fd4cd8 100755 --- a/bin/git-feature +++ b/bin/git-feature @@ -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 diff --git a/bin/git-refactor b/bin/git-refactor index 166f180..445c0d2 100755 --- a/bin/git-refactor +++ b/bin/git-refactor @@ -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 required." 1>&2 && exit 1 @@ -11,6 +10,5 @@ else echo "too many arguments; if not finishing a refactor, only 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