diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2018-10-07 17:46:40 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2018-10-08 13:41:41 +0000 |
commit | a05533e425ebb36044680f403666dab7bc26a075 (patch) | |
tree | 144d294e6c989465c5272a3776d62ee8fc7977db /Functions/VCS_Info/Backends | |
parent | c4144bc95b26c41e7c45c5185112f87f9145d94f (diff) | |
download | zsh-a05533e425ebb36044680f403666dab7bc26a075.tar.gz zsh-a05533e425ebb36044680f403666dab7bc26a075.tar.xz zsh-a05533e425ebb36044680f403666dab7bc26a075.zip |
43618: vcs_info: Don't redefine helper functions on every execution of the autoloadable outer function.
This allows enabling tracing of the helper functions without fned'ing the outer function.
Diffstat (limited to 'Functions/VCS_Info/Backends')
-rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_detect_p4 | 2 | ||||
-rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr | 3 | ||||
-rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 b/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 index 95a534786..d171c68ee 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 @@ -16,6 +16,7 @@ # of having such files in all client root directories and nowhere above. +(( ${+functions[VCS_INFO_p4_get_server]} )) || VCS_INFO_p4_get_server() { emulate -L zsh setopt extendedglob @@ -43,6 +44,7 @@ VCS_INFO_p4_get_server() { } +(( ${+functions[VCS_INFO_detect_p4]} )) || VCS_INFO_detect_p4() { local serverport p4where diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr index 705db65a7..b30e0e12b 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr @@ -8,6 +8,7 @@ local bzrbase bzrbr bzr_changes bzr_type local -a bzrinfo local -A hook_com bzr_info +(( ${+functions[VCS_INFO_bzr_get_info]} )) || VCS_INFO_bzr_get_info() { bzrinfo=( ${(s.:.)$( ${vcs_comm[cmd]} version-info --custom \ --template="{revno}:{branch_nick}:{clean}")} ) @@ -20,6 +21,7 @@ VCS_INFO_bzr_get_info() { fi } +(( ${+functions[VCS_INFO_bzr_get_info_restricted]} )) || VCS_INFO_bzr_get_info_restricted() { # we are forbidden from fetching info on bound branch from remote repository bzrinfo=( $(${vcs_comm[cmd]} revno) ${bzrbase:t} ) @@ -30,6 +32,7 @@ VCS_INFO_bzr_get_info_restricted() { fi } +(( ${+functions[VCS_INFO_bzr_get_changes]} )) || VCS_INFO_bzr_get_changes() { local -A counts local line flag diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 04d15bb4a..0050f613a 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -8,6 +8,7 @@ local -i querystaged queryunstaged local -a git_patches_applied git_patches_unapplied local -A hook_com +(( ${+functions[VCS_INFO_git_getaction]} )) || VCS_INFO_git_getaction () { local gitdir=$1 local tmp @@ -70,6 +71,7 @@ VCS_INFO_git_getaction () { return 1 } +(( ${+functions[VCS_INFO_git_getbranch]} )) || VCS_INFO_git_getbranch () { local gitdir=$1 tmp actiondir local gitsymref="${vcs_comm[cmd]} symbolic-ref HEAD" @@ -118,6 +120,7 @@ VCS_INFO_git_getbranch () { return 0 } +(( ${+functions[VCS_INFO_git_handle_patches]} )) || VCS_INFO_git_handle_patches () { local git_applied_s git_unapplied_s gitmsg git_patches_applied=(${(Oa)git_patches_applied}) |