Skip to content

Commit

Permalink
Postpone export of GIT_UPSTREAM until we know that it should be exported
Browse files Browse the repository at this point in the history
  • Loading branch information
ogr3 committed Mar 20, 2017
1 parent 2307170 commit 46aaea2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitprompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 46aaea2

Please sign in to comment.