1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-08-13 15:41:01 +02:00
zsh/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs
Aleksandr Mezin fc82e8193b 47561 (the git and cvs parts) (compare 44919 + 44920): vcs_info internals: cvs, git: Set ${vcs_comm[basedir]} like all other backends do.
That doesn't affect anything, not even other vcs_info internals; it's
just for consistency across backends.
2021-03-29 17:03:40 +00:00

24 lines
602 B
Bash

## vim:ft=zsh
## cvs support by: Frank Terbeck <ft@bewatermyfriend.org>
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
if ! [[ -d "./CVS" ]] || ! [[ -r "./CVS/Repository" ]] ; then
return 1
fi
# Look for the most distant parent that still has a CVS subdirectory.
local cvsbase="."
cvsbase=${cvsbase:P}
while [[ -d "${cvsbase:h}/CVS" ]]; do
cvsbase="${cvsbase:h}"
if [[ $cvsbase == '/' ]]; then
break
fi
done
vcs_comm[basedir]="${cvsbase}"