summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xradar-base.sh12
-rwxr-xr-xtest-colors.sh12
-rwxr-xr-xtest-format-config.sh14
3 files changed, 19 insertions, 19 deletions
diff --git a/radar-base.sh b/radar-base.sh
index b85f75f..47bcdf7 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -31,7 +31,7 @@ prepare_bash_colors() {
COLOR_BRANCH="\x01${GIT_RADAR_COLOR_BRANCH:-"\\033[0m"}\x02"
MASTER_SYMBOL="${GIT_RADAR_MASTER_SYMBOL:-"\\x01\\033[0m\\x02\\xF0\\x9D\\x98\\xAE\\x01\\033[0m\\x02"}"
- PROMPT_FORMAT="${GIT_RADAR_FORMAT:-" \\x01\\033[1;30m\\x02git:(\\x01\\033[0m\\x02%{remote}%{branch}%{ :local}\\x01\\033[1;30m\\x02)\\x01\\033[0m\\x02%{changes}"}"
+ PROMPT_FORMAT="${GIT_RADAR_FORMAT:-" \\x01\\033[1;30m\\x02git:(\\x01\\033[0m\\x02%{remote: }%{branch}%{ :local}\\x01\\033[1;30m\\x02)\\x01\\033[0m\\x02%{changes}"}"
RESET_COLOR_LOCAL="\x01${GIT_RADAR_COLOR_LOCAL_RESET:-"\\033[0m"}\x02"
RESET_COLOR_REMOTE="\x01${GIT_RADAR_COLOR_REMOTE_RESET:-"\\033[0m"}\x02"
@@ -67,7 +67,7 @@ prepare_zsh_colors() {
COLOR_BRANCH="%{${GIT_RADAR_COLOR_BRANCH:-$reset_color}%}"
MASTER_SYMBOL="${GIT_RADAR_MASTER_SYMBOL:-"%{$reset_color%}$italic_m%{$reset_color%}"}"
- PROMPT_FORMAT="${GIT_RADAR_FORMAT:-" $fg_bold[grey]git:($reset_color%{remote}%{branch}%{ :local}$fg_bold[grey])$reset_color%{changes}"}"
+ PROMPT_FORMAT="${GIT_RADAR_FORMAT:-" $fg_bold[grey]git:($reset_color%{remote: }%{branch}%{ :local}$fg_bold[grey])$reset_color%{changes}"}"
RESET_COLOR_LOCAL="%{${GIT_RADAR_COLOR_LOCAL_RESET:-$reset_color}%}"
RESET_COLOR_REMOTE="%{${GIT_RADAR_COLOR_REMOTE_RESET:-$reset_color}%}"
@@ -445,14 +445,14 @@ color_remote_commits() {
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 "
+ remote="$MASTER_SYMBOL $remote_behind $yellow_diverged_arrow $remote_ahead"
elif [[ "$remote_ahead" -gt "0" ]]; then
- remote="$MASTER_SYMBOL $green_ahead_arrow $remote_ahead "
+ remote="$MASTER_SYMBOL $green_ahead_arrow $remote_ahead"
elif [[ "$remote_behind" -gt "0" ]]; then
- remote="$MASTER_SYMBOL $remote_behind $red_behind_arrow "
+ remote="$MASTER_SYMBOL $remote_behind $red_behind_arrow"
fi
else
- remote="upstream $not_upstream "
+ remote="upstream $not_upstream"
fi
printf $PRINT_F_OPTION "$remote"
diff --git a/test-colors.sh b/test-colors.sh
index e28fb68..69efc49 100755
--- a/test-colors.sh
+++ b/test-colors.sh
@@ -380,7 +380,7 @@ test_bash_colors_remote() {
git checkout -b mybranch --quiet
git push --quiet -u origin mybranch >/dev/null
- printf -v expected "m 1 \x01remote-behind\x02→\x01remote-reset\x02 "
+ printf -v expected "m 1 \x01remote-behind\x02→\x01remote-reset\x02"
assertEquals "$expected" "$(bash_color_remote_commits)"
assertEquals "$expected" "$(color_remote_commits)"
@@ -389,14 +389,14 @@ test_bash_colors_remote() {
git commit -m "new commit" --quiet
git push --quiet >/dev/null
- printf -v expected "m 1 \x01remote-diverged\x02⇄\x01remote-reset\x02 1 "
+ printf -v expected "m 1 \x01remote-diverged\x02⇄\x01remote-reset\x02 1"
assertEquals "$expected" "$(bash_color_remote_commits)"
assertEquals "$expected" "$(color_remote_commits)"
git pull origin master --quiet >/dev/null
git push --quiet >/dev/null
- printf -v expected "m \x01remote-ahead\x02←\x01remote-reset\x02 2 "
+ printf -v expected "m \x01remote-ahead\x02←\x01remote-reset\x02 2"
assertEquals "$expected" "$(bash_color_remote_commits)"
assertEquals "$expected" "$(color_remote_commits)"
@@ -430,19 +430,19 @@ test_zsh_colors_remote() {
git checkout -b mybranch --quiet
git push --quiet -u origin mybranch >/dev/null
- assertEquals "m 1 %{remote-behind%}→%{remote-reset%} " "$(zsh_color_remote_commits)"
+ assertEquals "m 1 %{remote-behind%}→%{remote-reset%}" "$(zsh_color_remote_commits)"
echo "bar" > bar
git add .
git commit -m "new commit" --quiet
git push --quiet >/dev/null
- assertEquals "m 1 %{remote-diverged%}⇄%{remote-reset%} 1 " "$(zsh_color_remote_commits)"
+ assertEquals "m 1 %{remote-diverged%}⇄%{remote-reset%} 1" "$(zsh_color_remote_commits)"
git pull origin master --quiet >/dev/null
git push --quiet >/dev/null
- assertEquals "m %{remote-ahead%}←%{remote-reset%} 2 " "$(zsh_color_remote_commits)"
+ assertEquals "m %{remote-ahead%}←%{remote-reset%} 2" "$(zsh_color_remote_commits)"
rm_tmp
}
diff --git a/test-format-config.sh b/test-format-config.sh
index 036a87b..7999560 100755
--- a/test-format-config.sh
+++ b/test-format-config.sh
@@ -75,14 +75,14 @@ test_all_options_set_config() {
unset_colours
prompt="$(render_prompt)"
- assertEquals "$prompt" "m 1 → foo1↑ 1A"
+ assertEquals "$prompt" "m 1 →foo1↑ 1A"
export GIT_RADAR_FORMAT="%{remote}%{branch}%{changes}"
prepare_zsh_colors
unset_colours
prompt="$(render_prompt)"
- assertEquals "$prompt" "m 1 → foo 1A"
+ assertEquals "$prompt" "m 1 →foo 1A"
export GIT_RADAR_FORMAT="%{branch}%{local}%{changes}"
prepare_zsh_colors
@@ -116,21 +116,21 @@ test_reorder_parts() {
unset_colours
prompt="$(render_prompt)"
- assertEquals "foo1↑ 1Am 1 → " "$prompt"
+ assertEquals "foo1↑ 1Am 1 →" "$prompt"
export GIT_RADAR_FORMAT="%{local}%{changes}%{remote}%{branch}"
prepare_zsh_colors
unset_colours
prompt="$(render_prompt)"
- assertEquals "1↑ 1Am 1 → foo" "$prompt"
+ assertEquals "1↑ 1Am 1 →foo" "$prompt"
export GIT_RADAR_FORMAT="%{changes}%{remote}%{branch}%{local}"
prepare_zsh_colors
unset_colours
prompt="$(render_prompt)"
- assertEquals " 1Am 1 → foo1↑" "$prompt"
+ assertEquals " 1Am 1 →foo1↑" "$prompt"
rm_tmp
}
@@ -203,14 +203,14 @@ test_prefix_and_suffix_remote() {
unset_colours
prompt="$(render_prompt)"
- assertEquals "m 1 → " "$prompt"
+ assertEquals "m 1 →" "$prompt"
export GIT_RADAR_FORMAT="%{[:remote:]}"
prepare_zsh_colors
unset_colours
prompt="$(render_prompt)"
- assertEquals "[m 1 → ]" "$prompt"
+ assertEquals "[m 1 →]" "$prompt"
rm_tmp
}