about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2020-03-12 18:15:45 +0000
committerDaniel Shahaf <danielsh@apache.org>2020-03-15 00:18:27 +0000
commit5a1f5cf8ab32e598d06c024620468657c137d5c3 (patch)
tree237446864518908cebc7f3e53c8a98e37a4535a0 /Functions
parent8e128afb2c655d759d013c98002ef92795a5cafa (diff)
downloadzsh-5a1f5cf8ab32e598d06c024620468657c137d5c3.tar.gz
zsh-5a1f5cf8ab32e598d06c024620468657c137d5c3.tar.xz
zsh-5a1f5cf8ab32e598d06c024620468657c137d5c3.zip
45543: vcs_info quilt: Allow quiltcommand to be a function.
Before this commit, it could only be an external command.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/VCS_Info/VCS_INFO_quilt5
1 files changed, 3 insertions, 2 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index fef85964a..264dbed0e 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -133,7 +133,7 @@ function VCS_INFO_quilt-patch2subject() {
         # This zstyle call needs to be moved further up if `quilt' needs
         # to be run in more places than this one.
         zstyle -s "${context}" quiltcommand quiltcommand || quiltcommand='quilt'
-        quilt_env=(env)
+        quilt_env=()
         if [ -z "$patches" ]; then
             zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}"
             if [[ "${patches}" != /* ]]; then
@@ -147,7 +147,8 @@ function VCS_INFO_quilt-patch2subject() {
             fi
             quilt_env+=(QUILT_PATCHES="$patches")
         fi
-        unapplied=( ${(f)"$(${quilt_env[@]} $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
+        unapplied=( ${(f)"$(if (( $+quilt_env[1] )); then export ${quilt_env[@]}; fi
+                            $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
         unapplied=( ${unapplied:#} )
     else
         unapplied=()