summaryrefslogtreecommitdiff
path: root/Functions/VCS_Info/VCS_INFO_bydir_detect
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info/VCS_INFO_bydir_detect')
-rw-r--r--Functions/VCS_Info/VCS_INFO_bydir_detect10
1 files changed, 6 insertions, 4 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_bydir_detect b/Functions/VCS_Info/VCS_INFO_bydir_detect
index 0b5996fd8..70b0fb6fa 100644
--- a/Functions/VCS_Info/VCS_INFO_bydir_detect
+++ b/Functions/VCS_Info/VCS_INFO_bydir_detect
@@ -4,15 +4,17 @@
setopt localoptions NO_shwordsplit
local dirname=$1
-local basedir="." realbasedir
+local basedir="." realbasedir file
realbasedir="$(VCS_INFO_realpath ${basedir})"
while [[ ${realbasedir} != '/' ]]; do
[[ -r ${realbasedir} ]] || return 1
if [[ -n ${vcs_comm[detect_need_file]} ]] ; then
- [[ -d ${basedir}/${dirname} ]] && \
- [[ -e ${basedir}/${dirname}/${vcs_comm[detect_need_file]} ]] && \
- break
+ [[ -d ${basedir}/${dirname} ]] && {
+ for file in ${(s: :)${vcs_comm[detect_need_file]}}; do
+ [[ -e ${basedir}/${dirname}/${file} ]] && break 2
+ done
+ }
else
[[ -d ${basedir}/${dirname} ]] && break
fi