From f141cb2977c8c2aa8135796863bcb373784f6fc3 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 6 May 2008 21:58:20 +0100 Subject: [PATCH] Add warnings for unsupported repo types --- .zsh/zshrc/85_vcs_prompt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.zsh/zshrc/85_vcs_prompt b/.zsh/zshrc/85_vcs_prompt index d992511..814fed8 100644 --- a/.zsh/zshrc/85_vcs_prompt +++ b/.zsh/zshrc/85_vcs_prompt @@ -67,8 +67,9 @@ __vcs_set_prompt_variables() { local pre branch post local MAXLEN=25 + local repotype="${1:-$(__vcs_get_repo_type)}" - case "${1:-$(__vcs_get_repo_type)}" in + case "$repotype" in git) local reporoot="$(__git_get_repo_root)" set -- $(__get_prompt_path_components "$reporoot") @@ -80,6 +81,10 @@ __vcs_set_prompt_variables() pre="${(%)pre}" ;; *) + case "$repotype" in + NONE) :;; + *) warn "$repotype repositories not (yet) supported in the prompt";; + esac local p="%${MAXLEN}<..<%~%<<" #TODO find a better way so we don't have to nuke $psvar, but since the # %(nv.true.false) check for prompts checks element count, not -- 2.39.2