From 6c7a0457949aecbd3b7c576f208a89caf4b55ed6 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 2 Oct 2015 16:54:50 -0700 Subject: [PATCH] Cleaned up logic in bureau_git_prompt function --- themes/bureau.zsh-theme | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 3b3bdc80f..2adb9e913 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -64,17 +64,16 @@ bureau_git_status() { } bureau_git_prompt () { - local _branch=$(bureau_git_branch) - local _status=$(bureau_git_status) - local _result="" - if [[ "${_branch}x" != "x" ]]; then - _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch" - if [[ "${_status}x" != "x" ]]; then + if git rev-parse --git-dir > /dev/null 2>&1; then + local _branch=$(bureau_git_branch) + local _status=$(bureau_git_status) + local _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch" + if [[ -n "$_status" ]]; then _result="$_result $_status" fi _result="$_result$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo $_result fi - echo $_result }