Move the local variable to the else branch so that you don't do an unnecessary substitution

master
oGre 9 years ago
parent 47df726794
commit 737ebec4c0
  1. 3
      gitprompt.sh

@ -497,10 +497,11 @@ function updatePrompt() {
fi fi
export GIT_UPSTREAM="${git_status_fields[2]}" export GIT_UPSTREAM="${git_status_fields[2]}"
local GIT_FORMATTED_UPSTREAM="${GIT_PROMPT_UPSTREAM//_UPSTREAM_/\$GIT_UPSTREAM}"
if [[ -z "${__GIT_PROMPT_SHOW_UPSTREAM}" || "^" == "$GIT_UPSTREAM" ]]; then if [[ -z "${__GIT_PROMPT_SHOW_UPSTREAM}" || "^" == "$GIT_UPSTREAM" ]]; then
unset GIT_UPSTREAM unset GIT_UPSTREAM
unset GIT_FORMATTED_UPSTREAM unset GIT_FORMATTED_UPSTREAM
else
local GIT_FORMATTED_UPSTREAM="${GIT_PROMPT_UPSTREAM//_UPSTREAM_/\$GIT_UPSTREAM}"
fi fi
local GIT_STAGED=${git_status_fields[3]} local GIT_STAGED=${git_status_fields[3]}

Loading…
Cancel
Save