diff options
author | Michael Allen <michael@michaelallen.io> | 2015-09-16 14:31:23 +0100 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-09-16 14:31:23 +0100 |
commit | 2c0be1e2fd311a5fd18726b44be1a0ff8ae823e4 (patch) | |
tree | c4999bfd2cdae8f4d549295e00ff73448e87995e /radar-base.sh | |
parent | 223312b3ce46caaabb233d03722d6393e9631706 (diff) | |
download | git-sonar-2c0be1e2fd311a5fd18726b44be1a0ff8ae823e4.tar.gz git-sonar-2c0be1e2fd311a5fd18726b44be1a0ff8ae823e4.zip |
Merge the zsh/bash readable branch function
Diffstat (limited to 'radar-base.sh')
-rwxr-xr-x | radar-base.sh | 26 |
1 files 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 |