omb-prompt-base: do not attempt to process git vars outside a git tree (#443)

Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
Joe MacDonald
2023-05-23 17:35:31 -04:00
committed by GitHub
parent dd7807fcd2
commit e91797d914

View File

@@ -237,6 +237,7 @@ function git_status_summary {
function git_prompt_vars {
local details=''
local git_status_flags=''
[[ "$(command git rev-parse --is-inside-work-tree 2> /dev/null)" == "true" ]] || return 1
SCM_STATE=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
if [[ "$(command git config --get bash-it.hide-status)" != "1" ]]; then
[[ "${SCM_GIT_IGNORE_UNTRACKED}" = "true" ]] && git_status_flags='-uno'