diff options
author | Michael Allen <michael@michaelallen.io> | 2015-09-16 14:24:29 +0100 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-09-16 14:24:29 +0100 |
commit | 1285baa3c095962265dc07b515ac9c0f7e75b959 (patch) | |
tree | 09f963e6fbd6bf2cc1c395bb93fc2a725fee2d21 | |
parent | 9cfc2ed7f46fa9dea9fbeeef51a8ea8883c41c59 (diff) | |
download | git-sonar-1285baa3c095962265dc07b515ac9c0f7e75b959.tar.gz git-sonar-1285baa3c095962265dc07b515ac9c0f7e75b959.zip |
Merge zsh and bash remote commit diff
-rwxr-xr-x | radar-base.sh | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/radar-base.sh b/radar-base.sh index 12cab90..747cb5e 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -483,7 +483,7 @@ zsh_color_local_commits() { printf $PRINT_F_OPTION "$local_commits" } -bash_color_remote_commits() { +color_remote_commits() { local green_ahead_arrow="${COLOR_REMOTE_AHEAD}←$RESET_COLOR_REMOTE" local red_behind_arrow="${COLOR_REMOTE_BEHIND}→$RESET_COLOR_REMOTE" local yellow_diverged_arrow="${COLOR_REMOTE_DIVERGED}⇄$RESET_COLOR_REMOTE" @@ -507,29 +507,14 @@ bash_color_remote_commits() { printf $PRINT_F_OPTION "$remote" } -zsh_color_remote_commits() { - local green_ahead_arrow="${COLOR_REMOTE_AHEAD}←$RESET_COLOR_REMOTE" - local red_behind_arrow="${COLOR_REMOTE_BEHIND}→$RESET_COLOR_REMOTE" - local yellow_diverged_arrow="${COLOR_REMOTE_DIVERGED}⇄$RESET_COLOR_REMOTE" - local not_upstream="${COLOR_REMOTE_NOT_UPSTREAM}⚡$RESET_COLOR_REMOTE" - - if remote_branch="$(remote_branch_name)"; then - remote_ahead="$(remote_ahead_of_master "$remote_branch")" - remote_behind="$(remote_behind_of_master "$remote_branch")" - - if [[ "$remote_behind" -gt "0" && "$remote_ahead" -gt "0" ]]; then - remote="$MASTER_SYMBOL $remote_behind $yellow_diverged_arrow $remote_ahead " - elif [[ "$remote_ahead" -gt "0" ]]; then - remote="$MASTER_SYMBOL $green_ahead_arrow $remote_ahead " - elif [[ "$remote_behind" -gt "0" ]]; then - remote="$MASTER_SYMBOL $remote_behind $red_behind_arrow " - fi - else - remote="upstream $not_upstream " - fi +bash_color_remote_commits() { + color_remote_commits +} - printf $PRINT_F_OPTION "$remote" +zsh_color_remote_commits() { + color_remote_commits } + show_remote_status() { if [[ $@ == *$NO_REMOTE_STATUS* ]]; then return 1 # don't show the git remote status |