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

Signed-off-by: Joe MacDonald <[email protected]>
Co-authored-by: Koichi Murase <[email protected]>
This commit is contained in:
Joe MacDonald
2023-05-24 06:35:31 +09:00
committed by GitHub
co-authored by Koichi Murase
parent dd7807fcd2
commit e91797d914
+1
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'