mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
lib/omb-prompt-base: Fix unbound variable error
The variable `git_status_flags` was not declared in the function `git_prompt_vars`, so if `set -u` was set in bashrc, it would give unbound variable error constantly with `set -u`. Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user