summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2016-11-20 02:21:39 +0100
committerDaniel Hahler <git@thequod.de>2016-12-03 00:18:22 +0100
commitccf50048ac5bbef3f66164bd420d7c178ddd53ad (patch)
treeec119d4237b973e92b84a455858332f372275752 /Functions
parent7b7e84f0815ed22a0ee348a217776529035dccf3 (diff)
downloadzsh-ccf50048ac5bbef3f66164bd420d7c178ddd53ad.tar.gz
zsh-ccf50048ac5bbef3f66164bd420d7c178ddd53ad.tar.xz
zsh-ccf50048ac5bbef3f66164bd420d7c178ddd53ad.zip
Get subject of current patch in rebase-apply mode
Diffstat (limited to 'Functions')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git9
1 files changed, 9 insertions, 0 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..1560d7f27 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -236,6 +236,15 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
         done
         if [[ -f "${patchdir}/msg-clean" ]]; then
             subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
+        elif [[ -f "${patchdir}/${(l:4::0:)cur}" ]]; then
+            local maxlines=10 line
+            while IFS= read -r line;  do
+                if [[ "$line" == "Subject:"* ]]; then
+                    subject=${line/(#s)Subject: /}
+                    break
+                fi
+                (( --maxlines )) || break
+            done < "${patchdir}/${(l:4::0:)cur}"
         fi
         if [[ -f "${patchdir}/original-commit" ]]; then
             if [[ -n $subject ]]; then