We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 51080c2 + 8f10b91 commit 17ef3a6Copy full SHA for 17ef3a6
gitprompt.sh
@@ -320,6 +320,8 @@ function we_are_on_repo() {
320
321
function update_old_git_prompt() {
322
if [[ "${GIT_PROMPT_OLD_DIR_WAS_GIT:-0}" = 0 ]]; then
323
+ OLD_PROMPT_START="${PROMPT_START}"
324
+ OLD_PROMPT_END="${PROMPT_END}"
325
OLD_GITPROMPT="${PS1}"
326
fi
327
@@ -332,6 +334,8 @@ function setGitPrompt() {
332
334
local repo=$(git rev-parse --show-toplevel 2> /dev/null)
333
335
if [[ ! -e "${repo}" ]] && [[ "${GIT_PROMPT_ONLY_IN_REPO-}" = 1 ]]; then
336
# we do not permit bash-git-prompt outside git repos, so nothing to do
337
+ PROMPT_START=${OLD_PROMPT_START}
338
+ PROMPT_END=${OLD_PROMPT_END}
339
PS1="${OLD_GITPROMPT}"
340
return
341
0 commit comments