summaryrefslogtreecommitdiff
path: root/Functions/VCS_Info/VCS_INFO_set-patch-format
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info/VCS_INFO_set-patch-format')
-rw-r--r--Functions/VCS_Info/VCS_INFO_set-patch-format12
1 files changed, 12 insertions, 0 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_set-patch-format b/Functions/VCS_Info/VCS_INFO_set-patch-format
index 664b4563d..84febabd9 100644
--- a/Functions/VCS_Info/VCS_INFO_set-patch-format
+++ b/Functions/VCS_Info/VCS_INFO_set-patch-format
@@ -8,6 +8,10 @@
# $4 - name of a parameter to store the unapplied-string in
# $5 - context argument for use in zstyle getters
# $6 - name of a parameter to store a patch-format format string in
+#
+# Output:
+# - $hook_com is overwritten and the keys 'applied', 'applied-n',
+# 'unapplied', 'unapplied-n', 'all-n' are set.
{
local REPLY
if VCS_INFO_hook 'gen-applied-string' "${(@P)1}"; then
@@ -36,4 +40,12 @@
zstyle -s "${5}" nopatch-format REPLY || REPLY="no patch applied"
fi
: ${(P)6::=$REPLY}
+
+ hook_com=(
+ applied-n ${(P)#1}
+ applied ${(P)2}
+ unapplied-n ${(P)#3}
+ unapplied ${(P)4}
+ )
+ hook_com[all-n]=$(( ${hook_com[applied-n]} + ${hook_com[unapplied-n]} ))
}