From b142a4c378d82fcac0ee09bdd255206b20d875db Mon Sep 17 00:00:00 2001 From: JuneHyeon Bae Date: Sun, 7 Jun 2015 16:39:44 +0200 Subject: [PATCH 1/2] Use local command properly Prevent it from printing variable values --- plugins/git/git.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index e42e09688..f0916ac71 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,5 +1,5 @@ # Query/use custom command for `git`. -local git_cmd +local git_cmd= zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd : ${git_cmd:=git} @@ -12,7 +12,7 @@ zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd # Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if # it's not a symbolic ref, but in a Git repo. function current_branch() { - local ref + local ref= ref=$($git_cmd symbolic-ref --quiet HEAD 2> /dev/null) local ret=$? if [[ $ret != 0 ]]; then From cd56859e318de126c02599643adf656a49b18fc5 Mon Sep 17 00:00:00 2001 From: JuneHyeon Bae Date: Mon, 8 Jun 2015 11:50:45 +0200 Subject: [PATCH 2/2] Remove `local` line from the beginning of the file --- plugins/git/git.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index f0916ac71..ae5e0fcce 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,5 +1,4 @@ # Query/use custom command for `git`. -local git_cmd= zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd : ${git_cmd:=git} @@ -12,7 +11,7 @@ zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd # Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if # it's not a symbolic ref, but in a Git repo. function current_branch() { - local ref= + local ref ref=$($git_cmd symbolic-ref --quiet HEAD 2> /dev/null) local ret=$? if [[ $ret != 0 ]]; then