mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-09-21 10:27:09 +00:00
lib/omb-prompt-base: Check "oh-my-{bash,zsh}.hide-status" for git status
This commit is contained in:
parent
d55683133b
commit
1e326a7d6f
@ -108,6 +108,11 @@ function _omb_prompt_git {
|
||||
command git "$@"
|
||||
}
|
||||
|
||||
function _omb_prompt_git_status_enabled {
|
||||
[[ $(_omb_prompt_git config --get-regexp '^(oh-my-zsh|bash-it|oh-my-bash)\.hide-status$' |
|
||||
awk '$2== "1" {hide_status = 1;} END { print hide_status; }') != "1" ]]
|
||||
}
|
||||
|
||||
function scm {
|
||||
if [[ "$SCM_CHECK" = false ]]; then SCM=$SCM_NONE
|
||||
elif [[ -f .git/HEAD ]]; then SCM=$SCM_GIT
|
||||
@ -186,7 +191,7 @@ function git_prompt_minimal_info {
|
||||
local git_status_flags=('--porcelain')
|
||||
SCM_STATE=${SCM_THEME_PROMPT_CLEAN}
|
||||
|
||||
if [[ "$(_omb_prompt_git config --get bash-it.hide-status)" != "1" ]]; then
|
||||
if _omb_prompt_git_status_enabled; then
|
||||
# Get the branch reference
|
||||
ref=$(git_clean_branch) || \
|
||||
ref=$(_omb_prompt_git rev-parse --short HEAD 2> /dev/null) || return 0
|
||||
|
Loading…
Reference in New Issue
Block a user