mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-26 04:56:05 +02:00
fix(vcs_info): keep lazy wrapper recoverable on autoload failure
Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com>
This commit is contained in:
co-authored by
robbyrussell
parent
3fe8d6d6af
commit
e4172614e8
+7
-1
@@ -60,8 +60,14 @@ 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 || return 1
|
||||
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
|
||||
|
||||
# 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