From 18d7123ff4f2c5cdc37728b446d37c83e57492bf Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 14 Mar 2019 20:26:40 +0100 Subject: [PATCH] fish_git_prompt: Use `count` from stdin Removes any uses of `wc` in our codebase. --- share/functions/fish_git_prompt.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/fish_git_prompt.fish b/share/functions/fish_git_prompt.fish index 6f9657d1f..6ee0a8e5c 100644 --- a/share/functions/fish_git_prompt.fish +++ b/share/functions/fish_git_prompt.fish @@ -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