mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-16 17:50:09 +00:00
Double quote to prevent globbing and word splitting in git-aheadbehind.
This commit is contained in:
parent
1c91430aa4
commit
dfe4c109bd
1 changed files with 2 additions and 2 deletions
|
@ -452,12 +452,12 @@ function +vi-git-aheadbehind() {
|
|||
|
||||
# for git prior to 1.7
|
||||
# ahead=$(git rev-list origin/${branch_name}..HEAD | wc -l)
|
||||
ahead=$(git rev-list ${branch_name}@{upstream}..HEAD 2>/dev/null | wc -l)
|
||||
ahead=$(git rev-list "${branch_name}"@{upstream}..HEAD 2>/dev/null | wc -l)
|
||||
(( ahead )) && gitstatus+=( " %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_OUTGOING_CHANGES_ICON')${ahead// /}%f" )
|
||||
|
||||
# for git prior to 1.7
|
||||
# behind=$(git rev-list HEAD..origin/${branch_name} | wc -l)
|
||||
behind=$(git rev-list HEAD..${branch_name}@{upstream} 2>/dev/null | wc -l)
|
||||
behind=$(git rev-list HEAD.."${branch_name}"@{upstream} 2>/dev/null | wc -l)
|
||||
(( behind )) && gitstatus+=( " %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_INCOMING_CHANGES_ICON')${behind// /}%f" )
|
||||
|
||||
hook_com[misc]+=${(j::)gitstatus}
|
||||
|
|
Loading…
Reference in a new issue