diff options
-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 |