diff options
author | Claudio Bandera <claudio.bandera@kit.edu> | 2015-08-31 00:07:46 +0200 |
---|---|---|
committer | Claudio Bandera <claudio.bandera@kit.edu> | 2015-08-31 00:07:46 +0200 |
commit | 4a7d636bad0d03af22f440bef9bd141bfc0dc309 (patch) | |
tree | 680e32ee630ef44341fd4651c4435a846fd86bb1 /radar-base.sh | |
parent | 2cfe557beb7fec2e67ea8cd0096eeff0be14b00f (diff) | |
download | git-sonar-4a7d636bad0d03af22f440bef9bd141bfc0dc309.tar.gz git-sonar-4a7d636bad0d03af22f440bef9bd141bfc0dc309.zip |
Added tests for stash indicator
Diffstat (limited to 'radar-base.sh')
-rwxr-xr-x | radar-base.sh | 12 |
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 |