mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
lib/git.zsh: Allow themes to opt-out of an expensive git status call
If neither DIRTY nor CLEAN is defined then this function is a noop, so check up-front before making the call. This speeds up prompts that empty out these values.
This commit is contained in:
parent
c1dfabba69
commit
a481661251
1 changed files with 5 additions and 0 deletions
|
|
@ -8,6 +8,11 @@ function git_prompt_info() {
|
|||
|
||||
# Checks if working tree is dirty
|
||||
parse_git_dirty() {
|
||||
if [[ -z "$ZSH_THEME_GIT_PROMPT_DIRTY" &&
|
||||
-z "$ZSH_THEME_GIT_PROMPT_CLEAN" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local SUBMODULE_SYNTAX=''
|
||||
local GIT_STATUS=''
|
||||
local CLEAN_MESSAGE='nothing to commit (working directory clean)'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue