mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
fix: respect parse_git_dirty clean result
$dirty will be empty if parse_git_dirty returns a clean result - which may happen because the working directory is clean or because a configuration has been set (e.g., oh-my-zsh.hide-dirty) which disables the check. In either event, we should respect the former check and avoid querying for a dirty working directory a second time.
This commit is contained in:
parent
fd786291ba
commit
4891bf41fd
1 changed files with 5 additions and 1 deletions
|
@ -129,7 +129,11 @@ prompt_git() {
|
|||
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:*' get-revision true
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
if [[ -z $dirty ]]; then
|
||||
zstyle ':vcs_info:*' check-for-staged-changes true
|
||||
else
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
fi
|
||||
zstyle ':vcs_info:*' stagedstr '✚'
|
||||
zstyle ':vcs_info:*' unstagedstr '●'
|
||||
zstyle ':vcs_info:*' formats ' %u%c'
|
||||
|
|
Loading…
Reference in a new issue