mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-23 14:20:08 +00: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
|
||||
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