diff options
author | Michael Allen <michael@michaelallen.io> | 2015-03-09 11:23:25 +0000 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-03-09 11:23:25 +0000 |
commit | d95454d16ff21e860669287f194111367e3da9d2 (patch) | |
tree | c3606cc4d06695626d73383547f6b340d4948bcc | |
parent | 38dcfefff66da011a474fa95f96f71a8ae905a5b (diff) | |
download | git-sonar-d95454d16ff21e860669287f194111367e3da9d2.tar.gz git-sonar-d95454d16ff21e860669287f194111367e3da9d2.zip |
revert to grepping as when two remote branches are up to one commit things get weird
-rwxr-xr-x | git-base.sh | 4 |
1 files changed, 2 insertions, 2 deletions
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 |