summaryrefslogtreecommitdiff
path: root/plugins/gitfast/git-prompt.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2016-05-19 23:27:30 -0500
committerFelipe Contreras <felipe.contreras@gmail.com>2016-05-19 23:27:30 -0500
commiteec3dc607c40b33a828938e396a459e70d8b01ed (patch)
tree26d30003353d88ea98059914a013b096720b0900 /plugins/gitfast/git-prompt.sh
parent169cd8b6ca803721071795c6a207aa97265c8528 (diff)
downloadzsh-eec3dc607c40b33a828938e396a459e70d8b01ed.tar.gz
zsh-eec3dc607c40b33a828938e396a459e70d8b01ed.tar.bz2
zsh-eec3dc607c40b33a828938e396a459e70d8b01ed.zip
gitfast: update to upstream v2.8
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'plugins/gitfast/git-prompt.sh')
-rw-r--r--plugins/gitfast/git-prompt.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh
index f18aedc73..64219e631 100644
--- a/plugins/gitfast/git-prompt.sh
+++ b/plugins/gitfast/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