|
|
@ -125,6 +125,8 @@ function git-info {
|
|
|
|
local dirty=0
|
|
|
|
local dirty=0
|
|
|
|
local dirty_format
|
|
|
|
local dirty_format
|
|
|
|
local dirty_formatted
|
|
|
|
local dirty_formatted
|
|
|
|
|
|
|
|
local diverged
|
|
|
|
|
|
|
|
local diverged_formatted
|
|
|
|
local ignore_submodules
|
|
|
|
local ignore_submodules
|
|
|
|
local indexed=0
|
|
|
|
local indexed=0
|
|
|
|
local indexed_format
|
|
|
|
local indexed_format
|
|
|
@ -252,9 +254,14 @@ function git-info {
|
|
|
|
# Get ahead and behind counts.
|
|
|
|
# Get ahead and behind counts.
|
|
|
|
ahead_and_behind="$(${(z)ahead_and_behind_cmd} 2> /dev/null)"
|
|
|
|
ahead_and_behind="$(${(z)ahead_and_behind_cmd} 2> /dev/null)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ahead="$ahead_and_behind[(w)1]"
|
|
|
|
|
|
|
|
behind="$ahead_and_behind[(w)2]"
|
|
|
|
|
|
|
|
if (( ahead > 0 )) && (( behind > 0 )); then
|
|
|
|
|
|
|
|
zstyle -s ':prezto:module:git:info:diverged' format 'diverged_formatted'
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Format ahead.
|
|
|
|
# Format ahead.
|
|
|
|
if [[ -n "$ahead_format" ]]; then
|
|
|
|
if [[ -n "$ahead_format" ]]; then
|
|
|
|
ahead="$ahead_and_behind[(w)1]"
|
|
|
|
|
|
|
|
if (( ahead > 0 )); then
|
|
|
|
if (( ahead > 0 )); then
|
|
|
|
zformat -f ahead_formatted "$ahead_format" "A:$ahead"
|
|
|
|
zformat -f ahead_formatted "$ahead_format" "A:$ahead"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -262,7 +269,6 @@ function git-info {
|
|
|
|
|
|
|
|
|
|
|
|
# Format behind.
|
|
|
|
# Format behind.
|
|
|
|
if [[ -n "$behind_format" ]]; then
|
|
|
|
if [[ -n "$behind_format" ]]; then
|
|
|
|
behind="$ahead_and_behind[(w)2]"
|
|
|
|
|
|
|
|
if (( behind > 0 )); then
|
|
|
|
if (( behind > 0 )); then
|
|
|
|
zformat -f behind_formatted "$behind_format" "B:$behind"
|
|
|
|
zformat -f behind_formatted "$behind_format" "B:$behind"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -411,7 +417,8 @@ function git-info {
|
|
|
|
"s:$action_formatted" \
|
|
|
|
"s:$action_formatted" \
|
|
|
|
"S:$stashed_formatted" \
|
|
|
|
"S:$stashed_formatted" \
|
|
|
|
"U:$unmerged_formatted" \
|
|
|
|
"U:$unmerged_formatted" \
|
|
|
|
"u:$untracked_formatted"
|
|
|
|
"u:$untracked_formatted" \
|
|
|
|
|
|
|
|
"V:$diverged_formatted"
|
|
|
|
git_info[$info_format]="$REPLY"
|
|
|
|
git_info[$info_format]="$REPLY"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|