mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-21 18:46:06 +02:00
fix(vcs_info): avoid undefining wrapper during load transition
Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com>
This commit is contained in:
co-authored by
robbyrussell
parent
e4172614e8
commit
61f12e078f
+7
-8
@@ -60,14 +60,13 @@ if (( $+functions[VCS_INFO_formats] )); then
|
||||
}
|
||||
else
|
||||
function VCS_INFO_formats {
|
||||
functions -c VCS_INFO_formats _omz_vcs_info_formats_wrapper
|
||||
unfunction VCS_INFO_formats
|
||||
autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || {
|
||||
functions -c _omz_vcs_info_formats_wrapper VCS_INFO_formats
|
||||
unfunction _omz_vcs_info_formats_wrapper
|
||||
return 1
|
||||
}
|
||||
unfunction _omz_vcs_info_formats_wrapper
|
||||
local loaded_function="$(
|
||||
unfunction VCS_INFO_formats 2>/dev/null
|
||||
autoload -Uz +X VCS_INFO_formats 2>/dev/null || return 1
|
||||
print -r -- "$functions[VCS_INFO_formats]"
|
||||
)" || return 1
|
||||
functions[VCS_INFO_formats]="$loaded_function"
|
||||
autoload -Uz +X regexp-replace 2>/dev/null || return 1
|
||||
|
||||
# We use $tmp here because it's already a local variable in VCS_INFO_formats
|
||||
local PATCH='for tmp (base base-name branch misc revision subdir) hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"'
|
||||
|
||||
Reference in New Issue
Block a user