From faa07d064bb2bd9cd9892a255a4b63811242b9fb Mon Sep 17 00:00:00 2001 From: dana Date: Sat, 16 Jun 2018 12:03:23 -0500 Subject: 43030: Replace VCS_INFO_realpath() by :P --- Functions/VCS_Info/VCS_INFO_bydir_detect | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 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 70b0fb6fa..b20c05c9c 100644 --- a/Functions/VCS_Info/VCS_INFO_bydir_detect +++ b/Functions/VCS_Info/VCS_INFO_bydir_detect @@ -4,11 +4,11 @@ setopt localoptions NO_shwordsplit local dirname=$1 -local basedir="." realbasedir file +local basedir="." file -realbasedir="$(VCS_INFO_realpath ${basedir})" -while [[ ${realbasedir} != '/' ]]; do - [[ -r ${realbasedir} ]] || return 1 +basedir=${basedir:P} +while [[ ${basedir} != '/' ]]; do + [[ -r ${basedir} ]] || return 1 if [[ -n ${vcs_comm[detect_need_file]} ]] ; then [[ -d ${basedir}/${dirname} ]] && { for file in ${(s: :)${vcs_comm[detect_need_file]}}; do @@ -19,10 +19,9 @@ while [[ ${realbasedir} != '/' ]]; do [[ -d ${basedir}/${dirname} ]] && break fi - basedir=${basedir}/.. - realbasedir="$(VCS_INFO_realpath ${basedir})" + basedir=${basedir:h} done -[[ ${realbasedir} == "/" ]] && return 1 -vcs_comm[basedir]=${realbasedir} +[[ ${basedir} == "/" ]] && return 1 +vcs_comm[basedir]=${basedir} return 0 -- cgit v1.2.3