From d1fbc1b889f63f6ea3e9672b7069133493ccab8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=90=88?= <88maomao@gmail.com> Date: Wed, 6 Feb 2019 11:51:41 +0200 Subject: [PATCH] Hide errors from git ls-files --- functions/vcs.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/vcs.zsh b/functions/vcs.zsh index cb53dd3e..04a07e5d 100755 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -15,10 +15,10 @@ function +vi-git-untracked() { # dump out if we're outside a git repository (which includes being in the .git folder) [[ $? != 0 || -z $repoTopLevel ]] && return - local untrackedFiles=$(command git ls-files --others --exclude-standard "${repoTopLevel}") + local untrackedFiles=$(command git ls-files --others --exclude-standard "${repoTopLevel}" 2> /dev/null) if [[ -z $untrackedFiles && "$POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY" == "true" ]]; then - untrackedFiles+=$(command git submodule foreach --quiet --recursive 'command git ls-files --others --exclude-standard') + untrackedFiles+=$(command git submodule foreach --quiet --recursive 'command git ls-files --others --exclude-standard' 2> /dev/null) fi [[ -z $untrackedFiles ]] && return