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

[PATCH 5/9] vcs_info quilt: fix standalone detection



Since VCS_INFO_bydir_detect always uses the
vcs_comm[detect_need_file], it should be cleared when querying
it without file.
---
 Functions/VCS_Info/VCS_INFO_quilt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index 7001eca..db15dda 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -70,13 +70,11 @@ function VCS_INFO_quilt-dirfind() {
 
     olddir=${vcs_comm[basedir]}
     vcs_comm[basedir]=''
-    if [[ -n "${file}" ]]; then
-        oldfile=${vcs_comm[detect_need_file]}
-        vcs_comm[detect_need_file]=${file}
-    fi
+    oldfile=${vcs_comm[detect_need_file]}
+    vcs_comm[detect_need_file]=${file}
     VCS_INFO_bydir_detect ${dir}
     ret=$?
-    [[ -n "${file}" ]] && vcs_comm[detect_need_file]=${oldfile}
+    vcs_comm[detect_need_file]=${oldfile}
     printf '%s' ${vcs_comm[basedir]}
     vcs_comm[basedir]="${olddir}"
     return ${ret}
-- 
2.1.0



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