X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/0a2c5ed047d6c57887b1c4275a59cbc96d76ae92..fd9312417d57c0c41e23395bece4be00c94dc8df:/.zsh/zshrc/85_vcs_prompt diff --git a/.zsh/zshrc/85_vcs_prompt b/.zsh/zshrc/85_vcs_prompt index 63ccb65..d992511 100644 --- a/.zsh/zshrc/85_vcs_prompt +++ b/.zsh/zshrc/85_vcs_prompt @@ -52,11 +52,15 @@ __get_prompt_path_components() __vcs_get_repo_type() { - if __git_get_repo_root >/dev/null; then - echo git - else - echo NONE - fi + while true; do + [ -d .git ] && echo git && break + [ -d .bzr ] && echo bzr && break + [ -d .hg ] && echo hg && break + [ -d .svn ] && echo svn && break + [ -d CVS ] && echo cvs && break + [ "$PWD" = / ] && echo NONE && return 1 + cd .. + done } __vcs_set_prompt_variables() @@ -99,15 +103,15 @@ if ! is_root; then *${vcs}*) __vcs_set_prompt_variables esac } - precmd_functions+=_update_vcs prompt_vars_if_vcs_ran + precmd_functions+=_update_vcs_prompt_vars_if_vcs_ran _update_vcs_prompt_vars() { __vcs_set_prompt_variables } chpwd_functions+=_update_vcs_prompt_vars -fi -# call it once -_update_vcs_prompt_vars + # call it once + _update_vcs_prompt_vars +fi # vim:ft=zsh