mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-20 23:45:11 +08:00
fish_git_prompt: Use count
from stdin
Removes any uses of `wc` in our codebase.
This commit is contained in:
parent
e7a964fdfa
commit
18d7123ff4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user