Add an option about git submodules to ignore
$GIT_STATUS_IGNORE_SUBMODULES can be used to specify handling of submodules. It can be: not set : ignore dirty submodules (this was default zsh behavior) "git" : do not use "--ignore-submodules" and let git choose, this obeys setting in .gitmodules other : comes into "--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES"
This commit is contained in:
parent
accdcb2f1c
commit
267b7c1516
14
lib/git.zsh
14
lib/git.zsh
@ -15,7 +15,19 @@ function parse_git_dirty() {
|
|||||||
FLAGS=('--porcelain')
|
FLAGS=('--porcelain')
|
||||||
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
|
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
|
||||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||||
FLAGS+='--ignore-submodules=dirty'
|
case "$GIT_STATUS_IGNORE_SUBMODULES" in
|
||||||
|
"")
|
||||||
|
# if unset: ignore dirty submodules
|
||||||
|
FLAGS+="--ignore-submodules=dirty"
|
||||||
|
;;
|
||||||
|
"git")
|
||||||
|
# let git decide (this respects per-repo config in .gitmodules)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# other values are passed to --ignore-submodules
|
||||||
|
FLAGS+="--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
|
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
|
||||||
FLAGS+='--untracked-files=no'
|
FLAGS+='--untracked-files=no'
|
||||||
|
Loading…
Reference in New Issue
Block a user