From 3b2606db2e7eb6f05c67b229b5e3c68a1c3947a6 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Sun, 5 Jun 2022 16:50:34 +0300 Subject: [PATCH] Avoid ignoring submodules in git status for consistency (#631) --- pure.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index 97e17b2c..103a4119 100644 --- a/pure.zsh +++ b/pure.zsh @@ -302,10 +302,13 @@ prompt_pure_async_git_dirty() { untracked_git_mode='normal' fi + # Prevent e.g. `git status` from refreshing the index as a side effect. + export GIT_OPTIONAL_LOCKS=0 + if [[ $untracked_dirty = 0 ]]; then command git diff --no-ext-diff --quiet --exit-code else - test -z "$(GIT_OPTIONAL_LOCKS=0 command git status --porcelain --ignore-submodules -u${untracked_git_mode})" + test -z "$(command git status --porcelain -u${untracked_git_mode})" fi return $?