diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-01-23 18:15:35 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-01-25 04:22:31 +0000 |
| commit | 270285733442a46cd157ade4600e4073e255a563 (patch) | |
| tree | 2096f7f27cdd17be372b6b1b0d96f9286751802d /Functions/VCS_Info/Backends | |
| parent | 40403/0001: vcs_info set-patch-format helper: Part #1. (diff) | |
| download | zsh-270285733442a46cd157ade4600e4073e255a563.tar zsh-270285733442a46cd157ade4600e4073e255a563.tar.gz zsh-270285733442a46cd157ade4600e4073e255a563.tar.bz2 zsh-270285733442a46cd157ade4600e4073e255a563.tar.lz zsh-270285733442a46cd157ade4600e4073e255a563.tar.xz zsh-270285733442a46cd157ade4600e4073e255a563.tar.zst zsh-270285733442a46cd157ade4600e4073e255a563.zip | |
40403/0002: vcs_info set-patch-format helper: Part #2.
Not all callers reset ${hook_com}, but those that don't, immediately
overwrite it a few lines later.
Diffstat (limited to 'Functions/VCS_Info/Backends')
| -rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 8 | ||||
| -rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 11 |
2 files changed, 4 insertions, 15 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 9e0749cf5..974f393cf 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -125,12 +125,8 @@ VCS_INFO_git_handle_patches () { git_patches_unapplied=(${(Oa)git_patches_unapplied}) (( git_all = ${#git_patches_applied} + ${#git_patches_unapplied} )) - VCS_INFO_set-patch-format 'git_patches_applied' 'git_applied_s' - if VCS_INFO_hook 'gen-unapplied-string' "${git_patches_unapplied[@]}"; then - git_unapplied_s=${#git_patches_unapplied} - else - git_unapplied_s=${hook_com[unapplied-string]} - fi + VCS_INFO_set-patch-format 'git_patches_applied' 'git_applied_s' \ + 'git_patches_unapplied' 'git_unapplied_s' if (( ${#git_patches_applied} )); then zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" patch-format gitmsg || gitmsg="%p (%n applied)" diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg index 19bec7af1..90164fb52 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -203,15 +203,8 @@ if zstyle -T ":vcs_info:${vcs}:${usercontext}:${rrn}" get-mq \ done < ${mqseriesfile} fi - VCS_INFO_set-patch-format 'mqpatches' 'applied_string' - if VCS_INFO_hook 'gen-unapplied-string' "${mqunapplied[@]}"; then - unapplied_string=${#mqunapplied} - else - unapplied_string=${hook_com[unapplied-string]} - fi - - hook_com=() - + VCS_INFO_set-patch-format 'mqpatches' 'applied_string' \ + 'mqunapplied' 'unapplied_string' if VCS_INFO_hook 'gen-mqguards-string' "${mqguards[@]}"; then guards_string=${(j:,:)mqguards} else |
