Skip to content

Commit 433c8f3

Browse files
committed
Fixes #567 (unset variables access)
1 parent ed5ab01 commit 433c8f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitprompt.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ function setGitPrompt() {
351351
fi
352352

353353
local FETCH_REMOTE_STATUS=1
354-
if [[ "${GIT_PROMPT_FETCH_REMOTE_STATUS}" = 0 ]]; then
354+
if [[ "${GIT_PROMPT_FETCH_REMOTE_STATUS-}" = 0 ]]; then
355355
FETCH_REMOTE_STATUS=0
356356
fi
357357

@@ -527,7 +527,7 @@ function updatePrompt() {
527527
local PROMPT_END
528528
local EMPTY_PROMPT
529529
local Blue="\[\033[0;34m\]"
530-
if [ -n "$ZSH_VERSION" ]; then
530+
if [ -n "${ZSH_VERSION-}" ]; then
531531
Blue='%{fg[blue]%}'
532532
fi
533533

@@ -591,7 +591,7 @@ function updatePrompt() {
591591
fi
592592

593593
local BRANCH_PREFIX="$(get_branch_prefix $GIT_BRANCH $GIT_DETACHED_HEAD)"
594-
local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX_FINAL}${BRANCH_PREFIX}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}"
594+
local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX_FINAL}${BRANCH_PREFIX}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM-}"
595595
local STATUS=""
596596

597597
# __add_status KIND VALEXPR INSERT

0 commit comments

Comments
 (0)