diff options
author | Brian Gernhardt <brian@gernhardtsoftware.com> | 2013-07-03 00:41:20 -0400 |
---|---|---|
committer | Brian Gernhardt <brian@gernhardtsoftware.com> | 2013-07-26 22:05:06 -0400 |
commit | 914f83cb100c332f701ccacc5804c8b069fa2d41 (patch) | |
tree | 57b35e84532696508e67f49ea9700580cee4fd26 /share/functions/__fish_git_prompt.fish | |
parent | db969dc85a190d2254edc7c00e0bf91d7d3a784a (diff) |
git_prompt: add bash.showUntrackedFiles option
The option was added in git.git 66cb5d4, so pay attention to it like
we do the other bash.* options.
Diffstat (limited to 'share/functions/__fish_git_prompt.fish')
-rw-r--r-- | share/functions/__fish_git_prompt.fish | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 22cfa15c..caf58bec 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -38,7 +38,10 @@ # # If you would like to see if there are untracked files, then you can set # __fish_git_prompt_showuntrackedfiles to a nonempty value. If there are -# untracked files, then a '%' will be shown next to the branch name. +# untracked files, then a '%' will be shown next to the branch name. Once you +# have set __fish_git_prompt_showuntrackedfiles, you can override it on a +# per-repository basis by setting the bash.showUntrackedFiles config variable. +# As before, this variable remains named 'bash' to preserve compatibility. # # If you would like to see the difference between HEAD and its upstream, set # __fish_git_prompt_showupstream to 'auto'. A "<" indicates you are behind, ">" @@ -308,9 +311,11 @@ function __fish_git_prompt --description "Prompt function for Git" end if test -n "$__fish_git_prompt_showuntrackedfiles" - set -l files (git ls-files --others --exclude-standard) - if test -n "$files" - set u $___fish_git_prompt_char_untrackedfiles + if test (git config --bool bash.showUntrackedFiles) != false + set -l files (git ls-files --others --exclude-standard) + if test -n "$files" + set u $___fish_git_prompt_char_untrackedfiles + end end end end |