Skip to content

Commit

Permalink
Added config variable to preserve old PS1 outside of git repositories.
Browse files Browse the repository at this point in the history
…Fixes #44
  • Loading branch information
magicmonty committed Mar 25, 2014
1 parent ef60bf0 commit c942a2c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gitprompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ function git_prompt_config()
PROMPT_LEADING_SPACE=" "
fi

if [[ -n "${VIRTUAL_ENV}" ]]; then
EMPTY_PROMPT="(${Blue}$(basename "${VIRTUAL_ENV}")${ResetColor}) ${PROMPT_START}$($prompt_callback)${PROMPT_END}"
if [ "x${GIT_PROMPT_ONLY_IN_REPO}" == "x1" ]; then
EMPTY_PROMPT=$OLD_GITPROMPT
else
EMPTY_PROMPT="${PROMPT_START}$($prompt_callback)${PROMPT_END}"
if [[ -n "${VIRTUAL_ENV}" ]]; then
EMPTY_PROMPT="(${Blue}$(basename "${VIRTUAL_ENV}")${ResetColor}) ${PROMPT_START}$($prompt_callback)${PROMPT_END}"
else
EMPTY_PROMPT="${PROMPT_START}$($prompt_callback)${PROMPT_END}"
fi
fi

# fetch remote revisions every other $GIT_PROMPT_FETCH_TIMEOUT (default 5) minutes
Expand Down

0 comments on commit c942a2c

Please sign in to comment.