summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2016-02-20 14:08:43 +0200
committerLeonid Volnitsky <Leonid@Volnitsky.com>2016-02-20 14:08:43 +0200
commit69f92eed2fdb79bbf67e9d20fcfcc5c27888678a (patch)
treee67d9b1cdb754b03987bf168c72e28946f888623
parent-- it seems some script modified all my PNGs (diff)
downloadgit-prompt-69f92eed2fdb79bbf67e9d20fcfcc5c27888678a.tar.gz
git-prompt-69f92eed2fdb79bbf67e9d20fcfcc5c27888678a.tar.bz2
git-prompt-69f92eed2fdb79bbf67e9d20fcfcc5c27888678a.zip
fix: current directory display, was not abbrivated at home dir
-rwxr-xr-xgit-prompt.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index d1e88b3..cd41fbe 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -177,7 +177,15 @@ cwd_truncate() {
# arg1: max path lenght
# returns abbrivated $PWD in public "cwd" var
+ if [[ $PWD == $HOME ]]; then
+ cwd="~"
+ return
+ else
+ cwd=$PWD
+ fi
+
cwd="${PWD/$HOME/~}" # substitute "~"
+ return
case $1 in
full)
@@ -423,6 +431,7 @@ parse_git_status() {
#git_dir=` git rev-parse --git-dir 2> /dev/null`
[[ -n ${git_dir/./} ]] || return 1
+ [[ -f ${git_dir}/git-prompt-ignored ]] && return 1
vcs=git