From 46aaea2c334345162f5ec54f1e44beea32d50a1b Mon Sep 17 00:00:00 2001 From: oGre Date: Mon, 20 Mar 2017 21:02:12 +0100 Subject: [PATCH] Postpone export of GIT_UPSTREAM until we know that it should be exported --- gitprompt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gitprompt.sh b/gitprompt.sh index 7665662..5015a62 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -496,10 +496,11 @@ function updatePrompt() { unset GIT_REMOTE fi - export GIT_UPSTREAM="${git_status_fields[2]}" - if [[ -z "${__GIT_PROMPT_SHOW_UPSTREAM}" || "^" == "$GIT_UPSTREAM" ]]; then + local GIT_UPSTREAM_PRIVATE="${git_status_fields[2]}" + if [[ -z "${__GIT_PROMPT_SHOW_UPSTREAM}" || "^" == "$GIT_UPSTREAM_PRIVATE" ]]; then unset GIT_UPSTREAM else + export GIT_UPSTREAM=${GIT_UPSTREAM_PRIVATE} local GIT_FORMATTED_UPSTREAM="${GIT_PROMPT_UPSTREAM//_UPSTREAM_/\$GIT_UPSTREAM}" fi