From 3c020a9a9c3b0cee6c25e565e001e3bbc0e1c421 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sat, 19 Feb 2011 11:54:41 +0000 Subject: 28776: Let vcs_info detect very old mercurial repositories. --- Functions/VCS_Info/VCS_INFO_bydir_detect | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Functions/VCS_Info/VCS_INFO_bydir_detect') 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 -- cgit 1.4.1