From 2c0be1e2fd311a5fd18726b44be1a0ff8ae823e4 Mon Sep 17 00:00:00 2001
From: Michael Allen <michael@michaelallen.io>
Date: Wed, 16 Sep 2015 14:31:23 +0100
Subject: Merge the zsh/bash readable branch function

---
 radar-base.sh | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/radar-base.sh b/radar-base.sh
index a4c67a1..d9cd8f5 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -184,18 +184,6 @@ branch_ref() {
   fi
 }
 
-zsh_readable_branch_name() {
-  if is_repo; then
-    printf '%s' "$COLOR_BRANCH$(branch_name || printf '%s' "detached@$(commit_short_sha)")$RESET_COLOR_BRANCH"
-  fi
-}
-
-bash_readable_branch_name() {
-  if is_repo; then
-    printf "$COLOR_BRANCH$(branch_name || printf '%s' "detached@$(commit_short_sha)")$RESET_COLOR_BRANCH"
-  fi
-}
-
 remote_branch_name() {
   local localRef="\/$(branch_name)$"
   if [[ -n "$localRef" ]]; then
@@ -476,6 +464,20 @@ zsh_color_remote_commits() {
   color_remote_commits
 }
 
+readable_branch_name() {
+  if is_repo; then
+    printf $PRINT_F_OPTION "$COLOR_BRANCH$(branch_name || printf '%s' "detached@$(commit_short_sha)")$RESET_COLOR_BRANCH"
+  fi
+}
+
+zsh_readable_branch_name() {
+  readable_branch_name
+}
+
+bash_readable_branch_name() {
+  readable_branch_name
+}
+
 show_remote_status() {
   if [[ $@ == *$NO_REMOTE_STATUS* ]]; then
     return 1 # don't show the git remote status
-- 
cgit v1.2.3