mirror of
https://github.com/sorin-ionescu/prezto.git
synced 2025-01-23 06:52:15 +08:00
Compare commits
2 Commits
ab37c21c97
...
dcb55e079a
Author | SHA1 | Date | |
---|---|---|---|
|
dcb55e079a | ||
|
5ea4b989b1 |
@ -149,6 +149,9 @@ function git-info {
|
||||
local dirty=0
|
||||
local dirty_format
|
||||
local dirty_formatted
|
||||
local error=0
|
||||
local error_format
|
||||
local error_formatted
|
||||
local ignore_submodules
|
||||
local indexed=0
|
||||
local indexed_format
|
||||
@ -361,6 +364,7 @@ function git-info {
|
||||
else
|
||||
# Use porcelain status for easy parsing.
|
||||
status_cmd="command git status --porcelain --ignore-submodules=${ignore_submodules:-none}"
|
||||
${(z)status_cmd} &> /dev/null || error=1
|
||||
|
||||
# Get current status.
|
||||
while IFS=$'\n' read line; do
|
||||
@ -426,6 +430,12 @@ function git-info {
|
||||
zstyle -s ':prezto:module:git:info:clean' format 'clean_formatted'
|
||||
fi
|
||||
|
||||
# Format error.
|
||||
if (( error > 0 )); then
|
||||
zstyle -s ':prezto:module:git:info:error' format 'error_format'
|
||||
zformat -f error_formatted "$error_format" "E:$error"
|
||||
fi
|
||||
|
||||
# Format info.
|
||||
zstyle -a ':prezto:module:git:info:keys' format 'info_formats'
|
||||
for info_format in ${(k)info_formats}; do
|
||||
@ -438,6 +448,7 @@ function git-info {
|
||||
"c:$commit_formatted" \
|
||||
"d:$deleted_formatted" \
|
||||
"D:$dirty_formatted" \
|
||||
"E:$error_formatted" \
|
||||
"i:$indexed_formatted" \
|
||||
"I:$unindexed_formatted" \
|
||||
"m:$modified_formatted" \
|
||||
|
Loading…
Reference in New Issue
Block a user