all repos — nixfiles @ b0c124161c2df4e5762b918dfcbf142d61ea9a77

System and user configuration, managed by nix and home-manager

zsh: Optimise pure prompt git checking

Alan Pearce
commit

b0c124161c2df4e5762b918dfcbf142d61ea9a77

parent

f5035c449c73b3712078a43f044298f2498af405

1 file changed, 2 insertions(+), 2 deletions(-)

jump to
M zsh/functions/pure/prompt_pure_setupzsh/functions/pure/prompt_pure_setup
@@ -18,8 +18,8 @@ # %(?..) => prompt conditional - %(condition.true.false)
# fastest possible way to check if repo is dirty prompt_pure_git_dirty() { - # check if we're in a git repo - command git rev-parse --is-inside-work-tree &>/dev/null || return + # check if we're at the top level of a git repo + [[ -d .git ]] || return # check if it's dirty command git diff --quiet --ignore-submodules HEAD &>/dev/null