about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2022-01-27 17:58:13 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2022-01-29 11:04:43 +0000
commite52062170a41dd2ba5a03aef22af0545cbc1d58c (patch)
treeb218945d417831916e09bd12bcdc71f0fcdebb04 /Functions
parent04513dd5df31bc235691400b76a524d117cefede (diff)
downloadzsh-e52062170a41dd2ba5a03aef22af0545cbc1d58c.tar.gz
zsh-e52062170a41dd2ba5a03aef22af0545cbc1d58c.tar.xz
zsh-e52062170a41dd2ba5a03aef22af0545cbc1d58c.zip
49722: vcs_info quilt: Refactor for readability. No functional change.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/VCS_Info/VCS_INFO_quilt13
1 files changed, 7 insertions, 6 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index 06feb4cce..22212171a 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -92,7 +92,7 @@ function VCS_INFO_quilt-patch2subject() {
     emulate -L zsh
     setopt extendedglob
     local mode="$1"
-    local patches pc tmp qstring root
+    local patches pc qstring root
     local -i ret
     local context
     local -a applied unapplied applied_string unapplied_string quiltcommand quilt_env
@@ -135,12 +135,13 @@ function VCS_INFO_quilt-patch2subject() {
         zstyle -s "${context}" quiltcommand quiltcommand || quiltcommand='quilt'
         if [ -z "$patches" ]; then
             zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}"
+            : ${patches:="patches"}
             if [[ "${patches}" != /* ]]; then
-                tmp=${patches:-patches}
-                VCS_INFO_quilt-dirfind "${tmp}"
-                ret=$? patches=$REPLY
-                (( ret )) && return ${ret}
-                patches=${patches}/${tmp}
+                if VCS_INFO_quilt-dirfind "${patches}"; then
+                    patches="$REPLY/${patches}"
+                else
+                    return $?
+                fi
             else
                 [[ -d ${patches} ]] || return 1
             fi