Added config variable to preserve old PS1 outside of git repositories. Fixes #44

master
Martin Gondermann 12 years ago
parent ef60bf0b5e
commit c942a2c3cd
  1. 10
      gitprompt.sh

@ -104,10 +104,14 @@ function git_prompt_config()
PROMPT_LEADING_SPACE=" " PROMPT_LEADING_SPACE=" "
fi fi
if [[ -n "${VIRTUAL_ENV}" ]]; then if [ "x${GIT_PROMPT_ONLY_IN_REPO}" == "x1" ]; then
EMPTY_PROMPT="(${Blue}$(basename "${VIRTUAL_ENV}")${ResetColor}) ${PROMPT_START}$($prompt_callback)${PROMPT_END}" EMPTY_PROMPT=$OLD_GITPROMPT
else 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 fi
# fetch remote revisions every other $GIT_PROMPT_FETCH_TIMEOUT (default 5) minutes # fetch remote revisions every other $GIT_PROMPT_FETCH_TIMEOUT (default 5) minutes

Loading…
Cancel
Save