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

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

@ -104,11 +104,15 @@ function git_prompt_config()
PROMPT_LEADING_SPACE=" " PROMPT_LEADING_SPACE=" "
fi fi
if [ "x${GIT_PROMPT_ONLY_IN_REPO}" == "x1" ]; then
EMPTY_PROMPT=$OLD_GITPROMPT
else
if [[ -n "${VIRTUAL_ENV}" ]]; then if [[ -n "${VIRTUAL_ENV}" ]]; then
EMPTY_PROMPT="(${Blue}$(basename "${VIRTUAL_ENV}")${ResetColor}) ${PROMPT_START}$($prompt_callback)${PROMPT_END}" EMPTY_PROMPT="(${Blue}$(basename "${VIRTUAL_ENV}")${ResetColor}) ${PROMPT_START}$($prompt_callback)${PROMPT_END}"
else else
EMPTY_PROMPT="${PROMPT_START}$($prompt_callback)${PROMPT_END}" 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
GIT_PROMPT_FETCH_TIMEOUT=${1-5} GIT_PROMPT_FETCH_TIMEOUT=${1-5}

Loading…
Cancel
Save