diff options
author | Frank Terbeck <ft@bewatermyfriend.org> | 2011-06-02 10:50:35 +0200 |
---|---|---|
committer | Frank Terbeck <ft@bewatermyfriend.org> | 2011-06-02 10:50:35 +0200 |
commit | 2438a0e95aa448f0aeda468752444306b44fe7d0 (patch) | |
tree | 8477e9c6af360f6a89af13e8cb5f2a4f9c1cff2c /Functions/VCS_Info/VCS_INFO_bydir_detect | |
parent | b495ba1e5a3ab1396844490ad8cad17dec23d6c1 (diff) | |
parent | 21266db1d9ae433bf1dcb196a4e258c00541b599 (diff) | |
download | zsh-2438a0e95aa448f0aeda468752444306b44fe7d0.tar.gz zsh-2438a0e95aa448f0aeda468752444306b44fe7d0.zip |
Merge commit 'zsh-4.3.12' into debian
Diffstat (limited to 'Functions/VCS_Info/VCS_INFO_bydir_detect')
-rw-r--r-- | Functions/VCS_Info/VCS_INFO_bydir_detect | 10 |
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 |