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:32 +0000 |
commit | 2854a67e09748a2e6f4e1d8a73bc463bad4cbd4e (patch) | |
tree | 6f656b8bb66efa00fe635515f5b98bc5149bd40a /Functions/VCS_Info/Backends/VCS_INFO_get_data_git | |
parent | edd9798de765049a904e0afa830b191d1932087d (diff) | |
download | zsh-2854a67e09748a2e6f4e1d8a73bc463bad4cbd4e.tar.gz zsh-2854a67e09748a2e6f4e1d8a73bc463bad4cbd4e.tar.xz zsh-2854a67e09748a2e6f4e1d8a73bc463bad4cbd4e.zip |
40403/0004: vcs_info set-patch-format helper: Part #4.
This also fixes the %a (${hook_com[all-n]}) expando in the hg backend: before this change, it counted only unapplied changes.
Diffstat (limited to 'Functions/VCS_Info/Backends/VCS_INFO_get_data_git')
-rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 4d251497c..9a46c4eb7 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -120,20 +120,18 @@ VCS_INFO_git_getbranch () { } VCS_INFO_git_handle_patches () { - local git_applied_s git_unapplied_s gitmsg git_all + local git_applied_s git_unapplied_s gitmsg git_patches_applied=(${(Oa)git_patches_applied}) 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' \ 'git_patches_unapplied' 'git_unapplied_s' \ ":vcs_info:${vcs}:${usercontext}:${rrn}" gitmsg - hook_com=( applied "${git_applied_s}" unapplied "${git_unapplied_s}" - applied-n ${#git_patches_applied} unapplied-n ${#git_patches_unapplied} all-n ${git_all} ) if VCS_INFO_hook 'set-patch-format' "${gitmsg}"; then zformat -f gitmisc "${gitmsg}" "p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \ - "n:${#git_patches_applied}" "c:${#git_patches_unapplied}" "a:${git_all}" + "n:${#git_patches_applied}" "c:${#git_patches_unapplied}" \ + "a:${hook_com[all-n]}" else gitmisc=${hook_com[patch-replace]} fi |