diff options
author | Michael Allen <michael@michaelallen.io> | 2015-03-09 10:51:00 +0000 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-03-09 10:53:15 +0000 |
commit | 97caa1dce8f040e1eb217e6dda91a15d596a6615 (patch) | |
tree | e1c985d2cc06be36bf909260df62446f7f23f362 /git-base.sh | |
parent | 36b5102eefee2e56ea58f7488f73550e589f3703 (diff) | |
download | git-sonar-97caa1dce8f040e1eb217e6dda91a15d596a6615.tar.gz git-sonar-97caa1dce8f040e1eb217e6dda91a15d596a6615.zip |
remove unnecessary is_repo checks
Diffstat (limited to 'git-base.sh')
-rwxr-xr-x | git-base.sh | 28 |
1 files 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 } |