mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
Use local command properly
Prevent it from printing variable values
This commit is contained in:
parent
4224c2a1af
commit
b142a4c378
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue