diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-11-03 05:06:49 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-11-03 05:06:49 +0300 |
commit | cd0ad84b0100ca14ddb30d93a53094c0e9343e40 (patch) | |
tree | fd38492f5b356dd0f4a459b2676114bcab65cadb /functions/vcs.zsh | |
parent | ad14807cef372994c3ba00632117f6d43b798ffb (diff) |
Get rid of wc dependency when showing ahead/behind info
Diffstat (limited to 'functions/vcs.zsh')
-rwxr-xr-x | functions/vcs.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh index b99e7c86..1478e0e2 100755 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -33,12 +33,12 @@ function +vi-git-aheadbehind() { # for git prior to 1.7 # ahead=$(command git rev-list origin/${branch_name}..HEAD | wc -l) - ahead=$(command git rev-list "${branch_name}"@{upstream}..HEAD 2>/dev/null | wc -l) + ahead=$(command git rev-list --count "${branch_name}"@{upstream}..HEAD 2>/dev/null) (( ahead )) && gitstatus+=( " $(print_icon 'VCS_OUTGOING_CHANGES_ICON')${ahead// /}" ) # for git prior to 1.7 # behind=$(command git rev-list HEAD..origin/${branch_name} | wc -l) - behind=$(command git rev-list HEAD.."${branch_name}"@{upstream} 2>/dev/null | wc -l) + behind=$(command git rev-list --count HEAD.."${branch_name}"@{upstream} 2>/dev/null) (( behind )) && gitstatus+=( " $(print_icon 'VCS_INCOMING_CHANGES_ICON')${behind// /}" ) hook_com[misc]+=${(j::)gitstatus} |