Browse Source

zsh: slight performance optimization to git untracked detection

Thomas Dy 3 years ago
parent
commit
7b6c227386
1 changed files with 1 additions and 1 deletions
  1. 1 1
      .zsh/prompt.zsh

+ 1 - 1
.zsh/prompt.zsh

@@ -36,7 +36,7 @@ parse_git_state() {
   local GIT_CHANGED="$(git diff --name-only --diff-filter=ACDMRT | wc -l | tr -d ' ')"
   local GIT_STAGED="$(git diff --staged --name-status --diff-filter=ACDMRT | wc -l | tr -d ' ')"
   local GIT_CONFLICTS="$(git diff --staged --name-status --diff-filter=U | wc -l | tr -d ' ')"
-  local GIT_UNTRACKED="$(git ls-files --other --exclude-standard | wc -l | tr -d ' ')"
+  local GIT_UNTRACKED="$(git ls-files --other --exclude-standard | sed q | wc -l | tr -d ' ')"
 
   if [ $GIT_STAGED -ne 0 ]; then
     GIT_STATE="$GIT_STATE%F{green}+$GIT_STAGED%f"