mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-17 18:20:07 +00:00
Count stashes via ZSH
This commit is contained in:
parent
78df520772
commit
3256258ebf
1 changed files with 3 additions and 5 deletions
|
@ -96,11 +96,9 @@ function +vi-git-tagname() {
|
|||
# Show count of stashed changes
|
||||
# Port from https://github.com/whiteinge/dotfiles/blob/5dfd08d30f7f2749cfc60bc55564c6ea239624d9/.zsh_shouse_prompt#L268
|
||||
function +vi-git-stash() {
|
||||
local -a stashes
|
||||
|
||||
if [[ -s "${vcs_comm[gitdir]}/refs/stash" ]] ; then
|
||||
stashes=$(command git stash list 2>/dev/null | wc -l)
|
||||
hook_com[misc]+=" $(print_icon 'VCS_STASH_ICON')${stashes// /}"
|
||||
if [[ -s "${vcs_comm[gitdir]}/logs/refs/stash" ]] ; then
|
||||
local -a stashes=( "${(@f)"$(<${vcs_comm[gitdir]}/logs/refs/stash)"}" )
|
||||
hook_com[misc]+=" $(print_icon 'VCS_STASH_ICON')${#stashes}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue