summaryrefslogtreecommitdiff
path: root/lib/git.zsh
diff options
context:
space:
mode:
authorPatrick Moore <pat@finixpayments.com>2020-06-30 09:54:27 -0700
committerGitHub <noreply@github.com>2020-06-30 18:54:27 +0200
commite606ac70514fe31e40af53b818f07a967d185185 (patch)
treeccaaa8040b41133cacb9ac1d770f6fede8909f39 /lib/git.zsh
parentc4ac0d43addd4b3108e56a0ec77ce2074d93c25e (diff)
downloadzsh-e606ac70514fe31e40af53b818f07a967d185185.tar.gz
zsh-e606ac70514fe31e40af53b818f07a967d185185.tar.bz2
zsh-e606ac70514fe31e40af53b818f07a967d185185.zip
Handle unset variables in various parts of the codebase (#8944)
DISABLE_UNTRACKED_FILES_DIRTY, DISABLE_AUTO_TITLE, GIT_STATUS_IGNORE_SUBMODULES are not set Handle these variables not being set with conditional access. If the user has set -u option to report attempts to use undeclared / unassigned variable, accessing the variables needs to be conditional.
Diffstat (limited to 'lib/git.zsh')
-rw-r--r--lib/git.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index 00cb00b19..f7d4738ca 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -14,10 +14,10 @@ function parse_git_dirty() {
local -a FLAGS
FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
- if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
+ if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
- case "$GIT_STATUS_IGNORE_SUBMODULES" in
+ case "${GIT_STATUS_IGNORE_SUBMODULES:-}" in
git)
# let git decide (this respects per-repo config in .gitmodules)
;;