mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Don't show working status in the prompt when oh-my-zsh.hide-status is set. This is very useful for big repositories
where "git status" is very slow.
This commit is contained in:
parent
b6ea876971
commit
a052271af3
1 changed files with 42 additions and 40 deletions
|
|
@ -69,8 +69,9 @@ function git_prompt_long_sha() {
|
||||||
|
|
||||||
# Get the status of the working tree
|
# Get the status of the working tree
|
||||||
git_prompt_status() {
|
git_prompt_status() {
|
||||||
INDEX=$(git status --porcelain -b 2> /dev/null)
|
|
||||||
STATUS=""
|
STATUS=""
|
||||||
|
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
|
||||||
|
INDEX=$(git status --porcelain -b 2> /dev/null)
|
||||||
if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
|
if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
||||||
fi
|
fi
|
||||||
|
|
@ -111,6 +112,7 @@ git_prompt_status() {
|
||||||
if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
echo $STATUS
|
echo $STATUS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue