summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2019-11-06 19:55:59 -0700
committerTuowen Zhao <ztuowen@gmail.com>2019-11-06 19:55:59 -0700
commit1ffd2849fc056dced0c80a9ed8905f29ff9827a5 (patch)
tree41cff93f7b8d713d1500da68f0f670187ca86740 /lib
parent2e9fe98b8a9fe21b982e719e129678dede63771e (diff)
parent107e512c9e62b140d8591c578527c901b1db9d37 (diff)
downloadzsh-1ffd2849fc056dced0c80a9ed8905f29ff9827a5.tar.gz
zsh-1ffd2849fc056dced0c80a9ed8905f29ff9827a5.tar.bz2
zsh-1ffd2849fc056dced0c80a9ed8905f29ff9827a5.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'lib')
-rw-r--r--lib/git.zsh12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index 640561e97..2054fe272 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -12,11 +12,21 @@ function git_prompt_info() {
function parse_git_dirty() {
local STATUS
local -a FLAGS
- FLAGS=('--porcelain' '--ignore-submodules=dirty')
+ FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
+ case "$GIT_STATUS_IGNORE_SUBMODULES" in
+ git)
+ # let git decide (this respects per-repo config in .gitmodules)
+ ;;
+ *)
+ # if unset: ignore dirty submodules
+ # other values are passed to --ignore-submodules
+ FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}"
+ ;;
+ esac
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n $STATUS ]]; then