From 98e9afe73a2df757c892dc66046747b13898f140 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 5 May 2008 20:13:59 +0100 Subject: [PATCH 1/1] handle non-git directories --- .zsh/zshrc/85_git_prompt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zsh/zshrc/85_git_prompt b/.zsh/zshrc/85_git_prompt index 9d05cca..7e445b0 100644 --- a/.zsh/zshrc/85_git_prompt +++ b/.zsh/zshrc/85_git_prompt @@ -15,14 +15,14 @@ _get_git_cur_branch() { } _is_git_repo() { - [ $(git rev-parse --is-inside-work-tree) = true ] + [ "$(git rev-parse --is-inside-work-tree)" = true ] } _set_git_psvar() { if _is_git_repo; then psvar[1]="$(_get_git_cur_branch)" else - unset "psvar[1]" + [ -n "$psvar[1]" ] && unset "psvar[1]" fi } -- 2.39.5