summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-12-03 13:52:00 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-12-04 21:37:02 +0000
commitf71de84f1d9f7c2d63226a2e5534fc12d05ec716 (patch)
treefb1b3b020c8f6e0129b791bdf07e952850b889a9
parentd9237ccdbfb0f24ca40fead41de79e13b5f712be (diff)
downloadzsh-f71de84f1d9f7c2d63226a2e5534fc12d05ec716.tar.gz
zsh-f71de84f1d9f7c2d63226a2e5534fc12d05ec716.tar.xz
zsh-f71de84f1d9f7c2d63226a2e5534fc12d05ec716.zip
unposted: vcs_info git: Handle rebase-apply sequences with >=10000 patches.
Review-by: Frank Terbeck
-rw-r--r--ChangeLog3
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git9
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 05e39d2d1..67f8c7687 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-12-04  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* unposted: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
+	vcs_info git: Handle rebase-apply sequences with >=10000 patches.
+
 	* 40074: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
 	vcs_info git: rfc822-unfold rebase-apply patch subjects when
 	msg-clean is unavailable.
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index a92261fa3..65d8cb182 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -232,14 +232,17 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
         local cur=$(< $next)
         local p subject
         for ((p = 1; p < cur; p++)); do
-            git_patches_applied+=("$(printf "%04d" $p) ?")
+            printf -v "git_patches_applied[$p]"  "%04d ?" "$p"
         done
         if [[ -f "${patchdir}/msg-clean" ]]; then
             subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
-        elif [[ -f "${patchdir}/${(l:4::0:)cur}" ]]; then
+        elif local this_patch_file
+             printf -v this_patch_file "%s/%04d" "${patchdir}" "${cur}"
+             [[ -f $this_patch_file ]]
+        then
             () {
               local REPLY
-              VCS_INFO_patch2subject "${patchdir}/${(l:4::0:)cur}"
+              VCS_INFO_patch2subject "${this_patch_file}"
               subject=$REPLY
             }
         fi