summaryrefslogtreecommitdiff
path: root/Functions/VCS_Info
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git13
1 files changed, 12 insertions, 1 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 18ba89a9a..65d8cb182 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -232,10 +232,19 @@ 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 local this_patch_file
+ printf -v this_patch_file "%s/%04d" "${patchdir}" "${cur}"
+ [[ -f $this_patch_file ]]
+ then
+ () {
+ local REPLY
+ VCS_INFO_patch2subject "${this_patch_file}"
+ subject=$REPLY
+ }
fi
if [[ -f "${patchdir}/original-commit" ]]; then
if [[ -n $subject ]]; then
@@ -261,6 +270,7 @@ elif [[ -f "${gitdir}/MERGE_HEAD" ]]; then
# This is 'git merge --no-commit'
local -a heads=( ${(@f)"$(<"${gitdir}/MERGE_HEAD")"} )
local subject;
+ # TODO: maybe read up to the first blank line
IFS='' read -r subject < "${gitdir}/MERGE_MSG"
# $subject is the subject line of the would-be commit
# Maybe we can get the subject lines of MERGE_HEAD's commits cheaply?
@@ -286,6 +296,7 @@ elif [[ -f "${gitdir}/CHERRY_PICK_HEAD" ]]; then
# ### be "1". The %u/%c tuple will assume the values [(1,2), (1,1), (1,0)],
# ### whereas the correct sequence would be [(1,2), (2,1), (3,0)].
local subject
+ # TODO: maybe read up to the first blank line
IFS='' read -r subject < "${gitdir}/MERGE_MSG"
git_patches_applied=( "$(<${gitdir}/CHERRY_PICK_HEAD) ${subject}" )
if [[ -f "${gitdir}/sequencer/todo" ]]; then