Skip to content

Commit 5cd7e35

Browse files
committed
Fix incompatibility with an exported $CDPATH, fixes magicmonty#501
Because gitprompt.sh uses command cd to find __GIT_PROMPT_DIR it breaks if $CDPATH is used and exported. * Add unset CDPATH
1 parent 148d502 commit 5cd7e35

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gitprompt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function git_prompt_dir() {
1010
# assume the gitstatus.sh is in the same directory as this script
1111
# code thanks to http://stackoverflow.com/questions/59895
1212
if [[ -z "${__GIT_PROMPT_DIR:+x}" ]]; then
13+
unset CDPATH
1314
local SOURCE="${BASH_SOURCE[0]}"
1415
while [[ -h "${SOURCE}" ]]; do
1516
local DIR="$( command cd -P "$( dirname "${SOURCE}" )" && pwd )"

0 commit comments

Comments
 (0)