|
|
@ -145,7 +145,8 @@ function git-info() {
|
|
|
|
local deleted=0
|
|
|
|
local deleted=0
|
|
|
|
local deleted_format
|
|
|
|
local deleted_format
|
|
|
|
local deleted_formatted
|
|
|
|
local deleted_formatted
|
|
|
|
local dirty
|
|
|
|
local dirty=0
|
|
|
|
|
|
|
|
local dirty_format
|
|
|
|
local dirty_formatted
|
|
|
|
local dirty_formatted
|
|
|
|
local line_number=0
|
|
|
|
local line_number=0
|
|
|
|
local modified=0
|
|
|
|
local modified=0
|
|
|
@ -277,13 +278,7 @@ function git-info() {
|
|
|
|
branch="$match[1]"
|
|
|
|
branch="$match[1]"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
# Format dirty.
|
|
|
|
(( dirty++ ))
|
|
|
|
if [[ -z "$dirty" ]]; then
|
|
|
|
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' dirty 'dirty_formatted'
|
|
|
|
|
|
|
|
if [[ -z "$dirty_formatted" ]]; then
|
|
|
|
|
|
|
|
unset clean_formatted
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Count: added/deleted/modified/renamed/unmerged/untracked
|
|
|
|
# Count: added/deleted/modified/renamed/unmerged/untracked
|
|
|
|
[[ "$line" == (((A|M|D|T) )|(AD|AM|AT|MM))\ * ]] && (( added++ ))
|
|
|
|
[[ "$line" == (((A|M|D|T) )|(AD|AM|AT|MM))\ * ]] && (( added++ ))
|
|
|
@ -359,6 +354,12 @@ function git-info() {
|
|
|
|
zformat -f untracked_formatted "$untracked_format" "u:$untracked"
|
|
|
|
zformat -f untracked_formatted "$untracked_format" "u:$untracked"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Format dirty.
|
|
|
|
|
|
|
|
if [[ $dirty > 0 ]]; then
|
|
|
|
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' dirty 'dirty_format'
|
|
|
|
|
|
|
|
zformat -f dirty_formatted "$dirty_format" "D:$dirty"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Format prompts.
|
|
|
|
# Format prompts.
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' prompt 'prompt_format'
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' prompt 'prompt_format'
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' rprompt 'rprompt_format'
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' rprompt 'rprompt_format'
|
|
|
|