From 97caa1dce8f040e1eb217e6dda91a15d596a6615 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Mon, 9 Mar 2015 10:51:00 +0000 Subject: remove unnecessary is_repo checks --- git-base.sh | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/git-base.sh b/git-base.sh index d6401e5..baed750 100755 --- a/git-base.sh +++ b/git-base.sh @@ -100,14 +100,12 @@ commit_short_sha() { } branch_name() { - if is_repo; then - name="$(git symbolic-ref --short HEAD 2>/dev/null)" - retcode="$?" - if [[ "$retcode" == "0" ]]; then - echo "$name" - else - return 1 - fi + name="$(git symbolic-ref --short HEAD 2>/dev/null)" + retcode="$?" + if [[ "$retcode" == "0" ]]; then + echo "$name" + else + return 1 fi } @@ -124,14 +122,12 @@ readable_branch_name() { } remote_branch_name() { - if is_repo; then - local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads "$(git symbolic-ref -q HEAD)" )" - if [[ -n $remoteBranch ]]; then - echo $remoteBranch - return 0 - else - return 1 - fi + local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads "$(git symbolic-ref -q HEAD)" )" + if [[ -n $remoteBranch ]]; then + echo $remoteBranch + return 0 + else + return 1 fi } -- cgit v1.2.3