summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-09-16 14:28:19 +0100
committerMichael Allen <michael@michaelallen.io>2015-09-16 14:28:19 +0100
commit223312b3ce46caaabb233d03722d6393e9631706 (patch)
tree039f763214d0651edf03a02dd778ff6f3d373853
parentd4ce9372c1f5ee82ac019d5a3c84f8af64cb0e4f (diff)
downloadgit-sonar-223312b3ce46caaabb233d03722d6393e9631706.tar.gz
git-sonar-223312b3ce46caaabb233d03722d6393e9631706.zip
Merge the zsh/bash changes render function
-rwxr-xr-xradar-base.sh36
1 files changed, 6 insertions, 30 deletions
diff --git a/radar-base.sh b/radar-base.sh
index fb5fa90..a4c67a1 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -373,7 +373,7 @@ untracked_status() {
printf '%s' "$untracked_string"
}
-bash_color_changes_status() {
+color_changes_status() {
local separator="${1:- }"
local porcelain="$(porcelain_status)"
@@ -405,36 +405,12 @@ bash_color_changes_status() {
printf $PRINT_F_OPTION "$changes"
}
-zsh_color_changes_status() {
- local separator="${1:- }"
-
- local porcelain="$(porcelain_status)"
- local changes=""
-
- if [[ -n "$porcelain" ]]; then
- local staged_changes="$(staged_status "$porcelain" "$COLOR_CHANGES_STAGED" "$RESET_COLOR_CHANGES")"
- local unstaged_changes="$(unstaged_status "$porcelain" "$COLOR_CHANGES_UNSTAGED" "$RESET_COLOR_CHANGES")"
- local untracked_changes="$(untracked_status "$porcelain" "$COLOR_CHANGES_UNTRACKED" "$RESET_COLOR_CHANGES")"
- local conflicted_changes="$(conflicted_status "$porcelain" "$COLOR_CHANGES_CONFLICTED" "$RESET_COLOR_CHANGES")"
- if [[ -n "$staged_changes" ]]; then
- staged_changes="$separator$staged_changes"
- fi
-
- if [[ -n "$unstaged_changes" ]]; then
- unstaged_changes="$separator$unstaged_changes"
- fi
-
- if [[ -n "$conflicted_changes" ]]; then
- conflicted_changes="$separator$conflicted_changes"
- fi
-
- if [[ -n "$untracked_changes" ]]; then
- untracked_changes="$separator$untracked_changes"
- fi
+bash_color_changes_status() {
+ color_changes_status
+}
- changes="$staged_changes$conflicted_changes$unstaged_changes$untracked_changes"
- fi
- printf $PRINT_F_OPTION "$changes"
+zsh_color_changes_status() {
+ color_changes_status
}
color_local_commits() {