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/VCS_INFO_set-patch-format | |
parent | 0ea1957608a6b496fc244078ce9e24f00327aba9 (diff) | |
download | zsh-270285733442a46cd157ade4600e4073e255a563.tar.gz zsh-270285733442a46cd157ade4600e4073e255a563.tar.xz 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/VCS_INFO_set-patch-format')
-rw-r--r-- | Functions/VCS_Info/VCS_INFO_set-patch-format | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_set-patch-format b/Functions/VCS_Info/VCS_INFO_set-patch-format index 310df9625..0bbd4742b 100644 --- a/Functions/VCS_Info/VCS_INFO_set-patch-format +++ b/Functions/VCS_Info/VCS_INFO_set-patch-format @@ -4,6 +4,8 @@ # Parameters: # $1 - name of an array parameter to be the argument to gen-applied-string # $2 - name of a parameter to store the applied-string in +# $3 - name of an array parameter to be the argument to gen-unapplied-string +# $4 - name of a parameter to store the unapplied-string in { local REPLY if VCS_INFO_hook 'gen-applied-string' "${(@P)1}"; then @@ -17,4 +19,12 @@ fi : ${(P)2::=$REPLY} hook_com=() + + if VCS_INFO_hook 'gen-unapplied-string' "${(@P)3}"; then + REPLY=${(P)#3} + else + REPLY=${hook_com[unapplied-string]} + fi + : ${(P)4::=$REPLY} + hook_com=() } |