From b39651f1ad7d963dd55c0d33226ce9794b596f73 Mon Sep 17 00:00:00 2001 From: George Christou Date: Sun, 12 Aug 2018 20:12:10 +0100 Subject: [PATCH] completions: [git] Silence various errors outside repo --- share/completions/git.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 2240fc782..de84dd2d7 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -27,7 +27,7 @@ end function __fish_git_branches # This is much faster than using `git branch`, # and avoids having to deal with localized "detached HEAD" messages. - command git for-each-ref --format='%(refname)' refs/heads/ refs/remotes/ \ + command git for-each-ref --format='%(refname)' refs/heads/ refs/remotes/ 2>/dev/null \ | string replace -r '^refs/heads/(.*)$' '$1\tLocal Branch' \ | string replace -r '^refs/remotes/(.*)$' '$1\tRemote Branch' end @@ -39,7 +39,7 @@ function __fish_git_unique_remote_branches # `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`. command git for-each-ref --format="%(refname:strip=3)" \ --sort="refname:strip=3" \ - "refs/remotes/*/$match*" "refs/remotes/*/*/**" | \ + "refs/remotes/*/$match*" "refs/remotes/*/*/**" 2>/dev/null | \ uniq -u end