mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 21:51:05 +01:00
feat: plain color branch name when hide-dirty set
If hide-dirty is set, parse_git_dirty will not check the directory's status. Rather than coloring the git-status portion of the prompt green (which typically indicates a clean working directory) we color this portion of the prompt white to reflect the lack of information.
This commit is contained in:
parent
4891bf41fd
commit
05cfadc5d8
1 changed files with 2 additions and 0 deletions
|
@ -112,6 +112,8 @@ prompt_git() {
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
|
||||||
if [[ -n $dirty ]]; then
|
if [[ -n $dirty ]]; then
|
||||||
prompt_segment yellow black
|
prompt_segment yellow black
|
||||||
|
elif [[ "$(git config --get oh-my-zsh.hide-dirty 2>/dev/null)" = 1 ]]; then
|
||||||
|
prompt_segment white black
|
||||||
else
|
else
|
||||||
prompt_segment green $CURRENT_FG
|
prompt_segment green $CURRENT_FG
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue