fish_git_prompt: Use count from stdin

Removes any uses of `wc` in our codebase.
This commit is contained in:
Fabian Homborg 2019-03-14 20:26:40 +01:00
parent e7a964fdfa
commit 18d7123ff4

View File

@ -533,11 +533,11 @@ function __fish_git_prompt_informative_status
set -l x (count $stagedFiles)
set -l invalidstate (count (string match -r "U" -- $stagedFiles))
set -l stagedstate (math $x - $invalidstate)
set -l untrackedfiles (command git ls-files --others --exclude-standard | wc -l | string trim)
set -l untrackedfiles (command git ls-files --others --exclude-standard | count)
set -l stashstate 0
set -l stashfile "$argv[1]/logs/refs/stash"
if set -q __fish_git_prompt_showstashstate; and test -e "$stashfile"
set stashstate (wc -l $stashfile | string match -r '\d+')
set stashstate (count < $stashfile)
end
set -l info