summaryrefslogtreecommitdiffstats
path: root/git-base.sh
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-03-09 11:23:25 +0000
committerMichael Allen <michael@michaelallen.io>2015-03-09 11:23:25 +0000
commitd95454d16ff21e860669287f194111367e3da9d2 (patch)
treec3606cc4d06695626d73383547f6b340d4948bcc /git-base.sh
parent38dcfefff66da011a474fa95f96f71a8ae905a5b (diff)
downloadgit-sonar-d95454d16ff21e860669287f194111367e3da9d2.tar.gz
git-sonar-d95454d16ff21e860669287f194111367e3da9d2.zip
revert to grepping as when two remote branches are up to one commit things get weird
Diffstat (limited to 'git-base.sh')
-rwxr-xr-xgit-base.sh4
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