Merge pull request #358 from Charadon/master

lib/omb-prompt-base: Fix unbound variable error
This commit is contained in:
Koichi Murase
2022-09-29 18:13:43 +09:00
committed by GitHub

View File

@ -233,9 +233,10 @@ function git_status_summary {
function git_prompt_vars {
local details=''
local git_status_flags=''
SCM_STATE=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
if [[ "$(git config --get bash-it.hide-status)" != "1" ]]; then
[[ "${SCM_GIT_IGNORE_UNTRACKED}" = "true" ]] && local git_status_flags='-uno'
[[ "${SCM_GIT_IGNORE_UNTRACKED}" = "true" ]] && git_status_flags='-uno'
local status_lines=$((git status --porcelain ${git_status_flags} -b 2> /dev/null ||
git status --porcelain ${git_status_flags} 2> /dev/null) | git_status_summary)
local status=$(awk 'NR==1' <<< "$status_lines")