mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-12 21:39:48 +01:00
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
0ec59e25c7
commit
7cc3a32bff
1 changed files with 13 additions and 0 deletions
13
lib/git.zsh
13
lib/git.zsh
|
@ -17,6 +17,19 @@ function parse_git_dirty() {
|
||||||
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
|
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
|
||||||
FLAGS+='--untracked-files=no'
|
FLAGS+='--untracked-files=no'
|
||||||
fi
|
fi
|
||||||
|
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
|
||||||
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
|
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
|
||||||
fi
|
fi
|
||||||
if [[ -n $STATUS ]]; then
|
if [[ -n $STATUS ]]; then
|
||||||
|
|
Loading…
Reference in a new issue