Add a flag (SCM_GIT_IGNORE_UNTRACKED) to ignore untracked files in git prompt
parent
e257ca3768
commit
d0565e8954
|
|
@ -20,6 +20,7 @@ THEME_BATTERY_PERCENTAGE_CHECK=${THEME_BATTERY_PERCENTAGE_CHECK:=true}
|
||||||
|
|
||||||
SCM_GIT_SHOW_DETAILS=${SCM_GIT_SHOW_DETAILS:=true}
|
SCM_GIT_SHOW_DETAILS=${SCM_GIT_SHOW_DETAILS:=true}
|
||||||
SCM_GIT_SHOW_REMOTE_INFO=${SCM_GIT_SHOW_REMOTE_INFO:=auto}
|
SCM_GIT_SHOW_REMOTE_INFO=${SCM_GIT_SHOW_REMOTE_INFO:=auto}
|
||||||
|
SCM_GIT_IGNORE_UNTRACKED=${SCM_GIT_IGNORE_UNTRACKED:=false}
|
||||||
|
|
||||||
SCM_GIT='git'
|
SCM_GIT='git'
|
||||||
SCM_GIT_CHAR='±'
|
SCM_GIT_CHAR='±'
|
||||||
|
|
@ -95,7 +96,9 @@ function git_prompt_vars {
|
||||||
local details=''
|
local details=''
|
||||||
SCM_STATE=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
|
SCM_STATE=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
|
||||||
if [[ "$(git config --get bash-it.hide-status)" != "1" ]]; then
|
if [[ "$(git config --get bash-it.hide-status)" != "1" ]]; then
|
||||||
local status="$(git status -b --porcelain 2> /dev/null || git status --porcelain 2> /dev/null)"
|
[[ "${SCM_GIT_IGNORE_UNTRACKED}" = "true" ]] && local git_status_flags='-uno'
|
||||||
|
local status="$(git status -b --porcelain ${git_status_flags} 2> /dev/null ||
|
||||||
|
git status --porcelain ${git_status_flags} 2> /dev/null)"
|
||||||
if [[ -n "${status}" ]] && [[ "${status}" != "\n" ]] && [[ -n "$(grep -v ^# <<< "${status}")" ]]; then
|
if [[ -n "${status}" ]] && [[ "${status}" != "\n" ]] && [[ -n "$(grep -v ^# <<< "${status}")" ]]; then
|
||||||
SCM_DIRTY=1
|
SCM_DIRTY=1
|
||||||
if [[ "${SCM_GIT_SHOW_DETAILS}" = "true" ]]; then
|
if [[ "${SCM_GIT_SHOW_DETAILS}" = "true" ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue