summaryrefslogtreecommitdiff
path: root/Functions/VCS_Info/VCS_INFO_bydir_detect
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2011-02-19 11:54:41 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2011-02-19 11:54:41 +0000
commit3c020a9a9c3b0cee6c25e565e001e3bbc0e1c421 (patch)
treeafc4665da700688f97b98a48812bcabbe5840010 /Functions/VCS_Info/VCS_INFO_bydir_detect
parent24e97ba0464f688893fdc16eb4e4d0722cf7e7ef (diff)
downloadzsh-3c020a9a9c3b0cee6c25e565e001e3bbc0e1c421.tar.gz
zsh-3c020a9a9c3b0cee6c25e565e001e3bbc0e1c421.zip
28776: Let vcs_info detect very old mercurial repositories.
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