Clean up ignore submodules logic in parse_git_dirty

This commit is contained in:
Marc Cornellà 2019-11-06 19:41:13 +01:00
parent 7cc3a32bff
commit b7e37cea90

View file

@ -18,16 +18,13 @@ function parse_git_dirty() {
FLAGS+='--untracked-files=no' FLAGS+='--untracked-files=no'
fi fi
case "$GIT_STATUS_IGNORE_SUBMODULES" in case "$GIT_STATUS_IGNORE_SUBMODULES" in
"") git)
# if unset: ignore dirty submodules
FLAGS+="--ignore-submodules=dirty"
;;
"git")
# let git decide (this respects per-repo config in .gitmodules) # let git decide (this respects per-repo config in .gitmodules)
;; ;;
*) *)
# if unset: ignore dirty submodules
# other values are passed to --ignore-submodules # other values are passed to --ignore-submodules
FLAGS+="--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES" FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}"
;; ;;
esac esac
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1) STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)