summaryrefslogtreecommitdiffstats
path: root/radar-base.sh
diff options
context:
space:
mode:
authorClaudio Bandera <claudio.bandera@kit.edu>2015-08-31 00:07:46 +0200
committerClaudio Bandera <claudio.bandera@kit.edu>2015-08-31 00:07:46 +0200
commit4a7d636bad0d03af22f440bef9bd141bfc0dc309 (patch)
tree680e32ee630ef44341fd4651c4435a846fd86bb1 /radar-base.sh
parent2cfe557beb7fec2e67ea8cd0096eeff0be14b00f (diff)
downloadgit-sonar-4a7d636bad0d03af22f440bef9bd141bfc0dc309.tar.gz
git-sonar-4a7d636bad0d03af22f440bef9bd141bfc0dc309.zip
Added tests for stash indicator
Diffstat (limited to 'radar-base.sh')
-rwxr-xr-xradar-base.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/radar-base.sh b/radar-base.sh
index 1be76e4..ec907b0 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -470,16 +470,20 @@ zsh_color_remote_commits() {
printf %s "$remote"
}
+stashed_status() {
+ printf '%s' "$(git stash list | wc -l 2>/dev/null)"
+}
+
bash_stash_status() {
- local number_stashes="$(git stash list | wc -l)"
+ local number_stashes="$(stashed_status)"
if [ $number_stashes -gt 0 ]; then
- printf " $number_stashes\x01\033[1;33m\x02=\x01\033[0m\x02)"
+ printf " $number_stashes\x01\033[1;33m\x02=\x01\033[0m\x02"
fi
}
zsh_stash_status() {
- local number_stashes="$(git stash list | wc -l)"
+ local number_stashes="$(stashed_status)"
if [ $number_stashes -gt 0 ]; then
- printf %s " $number_stashes%{$fg_bold[yellow]%}=%{$reset_color%})"
+ printf %s " $number_stashes%{$fg_bold[yellow]%}=%{$reset_color%}"
fi
} \ No newline at end of file