summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-01-14 00:13:43 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-01-15 06:29:09 +0000
commitce1148db45b55b2977c72e4a4b78e51e709db022 (patch)
tree5f00d488c2d961cb4637453940ae5c777f3aaaa9
parent06ea248034eeb6d540b1a29badbeb14bb590fb11 (diff)
downloadzsh-ce1148db45b55b2977c72e4a4b78e51e709db022.tar.gz
zsh-ce1148db45b55b2977c72e4a4b78e51e709db022.tar.xz
zsh-ce1148db45b55b2977c72e4a4b78e51e709db022.zip
37612: vcs_info git: Set $git_patches_unapplied correctly for 'rebase-apply' case.
This manifested, e.g., in 'git am' of a single patch that had a conflict.
-rw-r--r--ChangeLog6
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cbbd36ff..f991b4e85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-15  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 37612: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
+	vcs_info git: Set $git_patches_unapplied correctly for
+	'rebase-apply' case.
+
 2016-01-14  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 37590: Src/Zle/zle_hist.c, Src/Zle/zle_main.c: Invoke
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index e1cee7439..472c10d5d 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -247,7 +247,9 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
             fi
         fi
         local last="$(< "${patchdir}/last")"
-        git_patches_unapplied=( {$cur..$last} )
+        if (( cur+1 <= last )); then
+          git_patches_unapplied=( {$((cur+1))..$last} )
+        fi
     fi
 
     VCS_INFO_git_handle_patches