summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-03-09 10:49:32 +0000
committerMichael Allen <michael@michaelallen.io>2015-03-09 10:49:32 +0000
commit85cdbb458956e1e9385be742e01108cfef921364 (patch)
treeb401bcdb3e31d7fcde82046e944c76682f050a85
parentd1d362fb8cf03263d259d91215b841c4aea2ac50 (diff)
downloadgit-sonar-85cdbb458956e1e9385be742e01108cfef921364.tar.gz
git-sonar-85cdbb458956e1e9385be742e01108cfef921364.zip
sped up remote_branch_name by not needing to call branch_name
-rwxr-xr-xgit-base.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-base.sh b/git-base.sh
index a110056..d6401e5 100755
--- a/git-base.sh
+++ b/git-base.sh
@@ -125,7 +125,7 @@ readable_branch_name() {
remote_branch_name() {
if is_repo; then
- local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads | grep "$(branch_name)")"
+ local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads "$(git symbolic-ref -q HEAD)" )"
if [[ -n $remoteBranch ]]; then
echo $remoteBranch
return 0