From feae99431a5b38095e3175f9e769437fb187143c Mon Sep 17 00:00:00 2001 From: Markus Krause Date: Sun, 6 Oct 2019 14:10:49 +0200 Subject: [PATCH] implement feedback --- themes/base.theme.bash | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index f92bd268..92031860 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -36,6 +36,7 @@ SCM_GIT_SHOW_STASH_INFO=${SCM_GIT_SHOW_STASH_INFO:=true} SCM_GIT_SHOW_COMMIT_COUNT=${SCM_GIT_SHOW_COMMIT_COUNT:=true} SCM_GIT_USE_GITSTATUSD=${SCM_GIT_USE_GITSTATUSD:=false} SCM_GIT_GITSTATUSD_LOC=${SCM_GIT_GITSTATUSD_LOC:="$HOME/gitstatus/gitstatus.plugin.sh"} +SCM_GIT_GITSTATUSD_RAN=${SCM_GIT_GITSTATUSD_RAN:=false} SCM_GIT='git' SCM_GIT_CHAR='±' @@ -193,13 +194,10 @@ function git_prompt_minimal_info { } function git_prompt_vars { - if ${SCM_GIT_USE_GITSTATUSD}; then # use faster gitstatusd - gitstatus_query # call gitstatusd - if [[ -z ${VCS_STATUS_WORKDIR} ]] ; then # this var is guaranteed to exist if query was successful - SCM_GIT_GITSTATUSD_RAN=false - else - SCM_GIT_GITSTATUSD_RAN=true # use this in githelpers and below to choose gitstatusd output - fi + if ${SCM_GIT_USE_GITSTATUSD} && gitstatus_query && [[ "${VCS_STATUS_RESULT}" == "ok-sync" ]]; then # use faster gitstatusd + SCM_GIT_GITSTATUSD_RAN=true # use this in githelpers and below to choose gitstatusd output + else + SCM_GIT_GITSTATUSD_RAN=false fi if _git-branch &> /dev/null; then