Skip to content

Commit 46aaea2

Browse files
committed
Postpone export of GIT_UPSTREAM until we know that it should be exported
1 parent 2307170 commit 46aaea2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitprompt.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,11 @@ function updatePrompt() {
496496
unset GIT_REMOTE
497497
fi
498498

499-
export GIT_UPSTREAM="${git_status_fields[2]}"
500-
if [[ -z "${__GIT_PROMPT_SHOW_UPSTREAM}" || "^" == "$GIT_UPSTREAM" ]]; then
499+
local GIT_UPSTREAM_PRIVATE="${git_status_fields[2]}"
500+
if [[ -z "${__GIT_PROMPT_SHOW_UPSTREAM}" || "^" == "$GIT_UPSTREAM_PRIVATE" ]]; then
501501
unset GIT_UPSTREAM
502502
else
503+
export GIT_UPSTREAM=${GIT_UPSTREAM_PRIVATE}
503504
local GIT_FORMATTED_UPSTREAM="${GIT_PROMPT_UPSTREAM//_UPSTREAM_/\$GIT_UPSTREAM}"
504505
fi
505506

0 commit comments

Comments
 (0)