summaryrefslogtreecommitdiff
path: root/git-prompt.sh
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2009-07-18 09:34:52 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2009-07-18 09:34:52 +0300
commit29289cb4baed36c25f4169c1949e93a325f84868 (patch)
treeddd4b472e59abccc1b822a43cccd168a2af6e51e /git-prompt.sh
parentfixed: cwd_truncate (diff)
downloadgit-prompt-29289cb4baed36c25f4169c1949e93a325f84868.tar.gz
git-prompt-29289cb4baed36c25f4169c1949e93a325f84868.tar.bz2
git-prompt-29289cb4baed36c25f4169c1949e93a325f84868.zip
-- fixed: bash < 3.1 don't support regex (cwd_truncate was disabled)
Diffstat (limited to 'git-prompt.sh')
-rwxr-xr-xgit-prompt.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index 50ef573..d8d6e2f 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -165,7 +165,12 @@ cwd_truncate() {
return
;;
*)
- local cwd_max_length=$1
+ if [[ ${BASH_VERSINFO[0]} -ge 3 && ${BASH_VERSINFO[1]} -ge 2 ]] ; then
+ local cwd_max_length=$1
+ else
+ # if bash < v3.2 then don't truncate
+ return
+ fi
;;
esac