From bb3fbb793c552dafeafcc4e6b48eeb8bd14e842d Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Thu, 30 Jul 2015 23:30:47 +0200 Subject: [PATCH] `test -n` seems to read the whole string. For performance issues we just analyze the first line by stripping the output of cat to the first line with `sed q`. --- powerlevel9k.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4982d5ae..a60114bc 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -337,7 +337,7 @@ prompt_vcs() { function +vi-git-untracked() { if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ - -n $(git ls-files --others --exclude-standard) ]]; then + -n $(git ls-files --others --exclude-standard | sed q) ]]; then hook_com[unstaged]+=" %F{$VCS_FOREGROUND_COLOR}$VCS_UNTRACKED_ICON%f" fi }