diff options
Diffstat (limited to 'contrib/completion/git-prompt.sh')
-rw-r--r-- | contrib/completion/git-prompt.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index f18aedc73b..64219e631a 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -66,6 +66,10 @@ # git always compare HEAD to @{upstream} # svn always compare HEAD to your SVN upstream # +# You can change the separator between the branch name and the above +# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator +# is SP. +# # By default, __git_ps1 will compare HEAD to your SVN upstream if it can # find one, or @{upstream} otherwise. Once you have set # GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by @@ -472,10 +476,9 @@ __git_ps1 () if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] && [ "$(git config --bool bash.showDirtyState)" != "false" ] then - git diff --no-ext-diff --quiet --exit-code || w="*" - if [ -n "$short_sha" ]; then - git diff-index --cached --quiet HEAD -- || i="+" - else + git diff --no-ext-diff --quiet || w="*" + git diff --no-ext-diff --cached --quiet || i="+" + if [ -z "$short_sha" ] && [ -z "$i" ]; then i="#" fi fi @@ -487,7 +490,7 @@ __git_ps1 () if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] && [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] && - git ls-files --others --exclude-standard --error-unmatch -- ':/*' >/dev/null 2>/dev/null + git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null then u="%${ZSH_VERSION+%}" fi |