Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] fixup! [RFC] Get subject of current patch in rebase-apply mode



From: Daniel Hahler <git@xxxxxxxxxx>

---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 93172fc..1560d7f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -236,15 +236,15 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
         done
         if [[ -f "${patchdir}/msg-clean" ]]; then
             subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
-        else
-            local maxlines=10
-            while IFS='\n' read -r;  do
-                if [[ "$REPLY" == "Subject:"* ]]; then
-                    subject=${REPLY/(#s)Subject: /}
+        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}/$(printf "%04d" $cur)"
+            done < "${patchdir}/${(l:4::0:)cur}"
         fi
         if [[ -f "${patchdir}/original-commit" ]]; then
             if [[ -n $subject ]]; then
-- 
2.10.2



Messages sorted by: Reverse Date, Date, Thread, Author