summaryrefslogtreecommitdiffstats
path: root/radar-base.sh
diff options
context:
space:
mode:
Diffstat (limited to 'radar-base.sh')
-rwxr-xr-xradar-base.sh22
1 files changed, 10 insertions, 12 deletions
diff --git a/radar-base.sh b/radar-base.sh
index 6a9c630..9527343 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -197,20 +197,18 @@ branch_ref() {
}
remote_branch_name() {
- local localRef="\/$(branch_name)$"
- if [[ -n "$localRef" ]]; then
- local remote="$(git config --get-regexp "^branch\.$localRef\.remote" | awk '{print $2}')"
- if [[ -n $remote ]]; then
- local remoteBranch="$(git config --get-regexp "^branch\.${localRef}\.merge" | awk -F'/' '{print $NF}')"
- if [[ -n $remoteBranch ]]; then
- printf '%s/%s' $remote $remoteBranch
- return 0
- else
- return 1
- fi
+ local localRef="$(branch_name)"
+ local remote="$(git config --get-regexp "^branch\.$localRef\.remote" | awk '{print $2}')"
+ if [[ -n $remote ]]; then
+ local remoteBranch="$(git config --get-regexp "^branch\.${localRef}\.merge" | awk -F'/' '{print $NF}')"
+ if [[ -n $remoteBranch ]]; then
+ printf '%s/%s' $remote $remoteBranch
+ return 0
else
- return 1
+ return 1
fi
+ else
+ return 1
fi
}