From d95454d16ff21e860669287f194111367e3da9d2 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Mon, 9 Mar 2015 11:23:25 +0000 Subject: revert to grepping as when two remote branches are up to one commit things get weird --- git-base.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-base.sh') diff --git a/git-base.sh b/git-base.sh index 94e9070..40f733b 100755 --- a/git-base.sh +++ b/git-base.sh @@ -122,8 +122,8 @@ readable_branch_name() { } remote_branch_name() { - local localRef="$(git symbolic-ref -q HEAD 2>/dev/null)" - local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads $localRef 2>/dev/null)" + local localRef="$(branch_name)" + local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads $localRef 2>/dev/null | grep $localRef)" if [[ -n $remoteBranch ]]; then echo $remoteBranch return 0 -- cgit v1.2.3