Cleaned up logic in bureau_git_prompt function

This commit is contained in:
Steven 2015-10-02 16:54:50 -07:00 committed by Steven Spasbo
commit 6c7a045794

View file

@ -64,17 +64,16 @@ bureau_git_status() {
} }
bureau_git_prompt () { bureau_git_prompt () {
if git rev-parse --git-dir > /dev/null 2>&1; then
local _branch=$(bureau_git_branch) local _branch=$(bureau_git_branch)
local _status=$(bureau_git_status) local _status=$(bureau_git_status)
local _result="" local _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch"
if [[ "${_branch}x" != "x" ]]; then if [[ -n "$_status" ]]; then
_result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch"
if [[ "${_status}x" != "x" ]]; then
_result="$_result $_status" _result="$_result $_status"
fi fi
_result="$_result$ZSH_THEME_GIT_PROMPT_SUFFIX" _result="$_result$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
echo $_result echo $_result
fi
} }