Update init.zsh
This commit is contained in:
parent
030c8cc342
commit
690b39658e
1 changed files with 3 additions and 6 deletions
|
@ -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.
|
||||
# Get ahead and behind counts from the commit difference counts between local and remote.
|
||||
local ahead_and_behind
|
||||
ahead_and_behind=${(z)$(${ahead_and_behind_cmd} 2>/dev/null)}
|
||||
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]}
|
||||
|
||||
|
|
Loading…
Reference in a new issue