From 690b39658e2d2605f294cd1f031cd593ffeb8e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=84=B3ichiel=20=E2=84=9Boos?= Date: Wed, 10 May 2017 10:39:42 +0200 Subject: [PATCH] Update init.zsh --- modules/git-info/init.zsh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/git-info/init.zsh b/modules/git-info/init.zsh index 7b087a1..2b65b3b 100644 --- a/modules/git-info/init.zsh +++ b/modules/git-info/init.zsh @@ -174,12 +174,9 @@ git-info() { zstyle -s ':zim:git-info:behind' format 'behind_format' zstyle -s ':zim:git-info:diverged' format 'diverged_format' if [[ -n ${ahead_format} || -n ${behind_format} || -n ${diverged_format} ]]; then - # Gets the commit difference counts between local and remote. - local ahead_and_behind_cmd='command git rev-list --count --left-right HEAD...@{upstream}' - - # Get ahead and behind counts. - local ahead_and_behind - ahead_and_behind=${(z)$(${ahead_and_behind_cmd} 2>/dev/null)} + # Get ahead and behind counts from the commit difference counts between local and remote. + local ahead_and_behind + ahead_and_behind=${(z)$(command git rev-list --count --left-right HEAD...@{upstream} 2>/dev/null)} local ahead=${ahead_and_behind[(w)1]} local behind=${ahead_and_behind[(w)2]}