zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Cc: Marc Finet <m.dreadlock@gmail.com>
Subject: [PATCH 1/2] vcs_info quilt: Refactor for readability. No functional change.
Date: Thu, 27 Jan 2022 17:58:13 +0000	[thread overview]
Message-ID: <20220127175814.10179-1-danielsh@tarpaulin.shahaf.local2> (raw)

---
 Functions/VCS_Info/VCS_INFO_quilt | 13 +++++++------
 1 file 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


             reply	other threads:[~2022-01-27 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 17:58 Daniel Shahaf [this message]
2022-01-27 17:58 ` [PATCH 2/2] vcs_info quilt: Use quilt-patch-dir and ${QUILT_PATCHES} even when get-unapplied hasn't been set Daniel Shahaf
2022-01-27 18:12   ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220127175814.10179-1-danielsh@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=m.dreadlock@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).