X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/429bc5d0944d0553c6949561f41abe40e2e05601..a656bad86ed38a14a8f57b0fa31c6c7dfe5dd6f4:/.zsh/zshrc/85_git_prompt?ds=inline diff --git a/.zsh/zshrc/85_git_prompt b/.zsh/zshrc/85_git_prompt index 9d05cca..626b4c3 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 2>/dev/null)" = 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 }