diff options
Diffstat (limited to 'radar-base.sh')
-rwxr-xr-x | radar-base.sh | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/radar-base.sh b/radar-base.sh index 747cb5e..fb5fa90 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -437,7 +437,7 @@ zsh_color_changes_status() { printf $PRINT_F_OPTION "$changes" } -bash_color_local_commits() { +color_local_commits() { local separator="${1:- }" local green_ahead_arrow="${COLOR_LOCAL_AHEAD}↑$RESET_COLOR_LOCAL" @@ -460,27 +460,12 @@ bash_color_local_commits() { printf $PRINT_F_OPTION "$local_commits" } -zsh_color_local_commits() { - local separator="${1:- }" - - local ahead_arrow="${COLOR_LOCAL_AHEAD}↑$RESET_COLOR_LOCAL" - local behind_arrow="${COLOR_LOCAL_BEHIND}↓$RESET_COLOR_LOCAL" - local diverged_arrow="${COLOR_LOCAL_DIVERGED}⇵$RESET_COLOR_LOCAL" - - local local_commits="" - if remote_branch="$(remote_branch_name)"; then - local_ahead="$(commits_ahead_of_remote "$remote_branch")" - local_behind="$(commits_behind_of_remote "$remote_branch")" +bash_color_local_commits() { + color_local_commits +} - if [[ "$local_behind" -gt "0" && "$local_ahead" -gt "0" ]]; then - local_commits="$separator$local_behind$diverged_arrow$local_ahead" - elif [[ "$local_behind" -gt "0" ]]; then - local_commits="$separator$local_behind$behind_arrow" - elif [[ "$local_ahead" -gt "0" ]]; then - local_commits="$separator$local_ahead$ahead_arrow" - fi - fi - printf $PRINT_F_OPTION "$local_commits" +zsh_color_local_commits() { + color_local_commits } color_remote_commits() { |