Skip to content

Commit

Permalink
Avoid ignoring submodules in git status for consistency (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
mafredri authored Jun 5, 2022
1 parent de5b445 commit 3b2606d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $?
Expand Down

0 comments on commit 3b2606d

Please sign in to comment.