Simplify Git submodule ignore settings

main
Sorin Ionescu 13 years ago
parent b47b845b13
commit d13b697792

@ -58,11 +58,8 @@
# # Right prompt. # # Right prompt.
# zstyle ':omz:module:git' rprompt '' # zstyle ':omz:module:git' rprompt ''
# #
# # Ignore submodule.
# zstyle ':omz:module:git:ignore' submodule 'no'
#
# # Ignore submodule when it is 'dirty', 'untracked', 'all', or 'none'. # # Ignore submodule when it is 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':omz:module:git:ignore:submodule' when 'all' # zstyle ':omz:module:git:ignore' submodule ''
# #
# Gets the path to the Git directory. # Gets the path to the Git directory.
@ -197,7 +194,6 @@ function git-info {
local dirty_format local dirty_format
local dirty_formatted local dirty_formatted
local ignore_submodule local ignore_submodule
local ignore_submodule_when
local line_number=0 local line_number=0
local modified=0 local modified=0
local modified_format local modified_format
@ -265,12 +261,9 @@ function git-info {
ahead_and_behind_cmd='git rev-list --count --left-right HEAD...@{upstream}' ahead_and_behind_cmd='git rev-list --count --left-right HEAD...@{upstream}'
# Ignore submodule status. # Ignore submodule status.
zstyle -b \ zstyle -s ':omz:module:git:ignore' submodule 'ignore_submodule'
':omz:module:git:ignore' submodule 'ignore_submodule' if [[ -n "$ignore_submodule" ]]; then
zstyle -s \ status_cmd+=" --ignore-submodules=${ignore_submodule}"
':omz:module:git:ignore:submodule' when 'ignore_submodule_when'
if is-true "$ignore_submodule"; then
status_cmd+=" --ignore-submodules=${ignore_submodule_when:-all}"
fi fi
# Format commit. # Format commit.

Loading…
Cancel
Save