From b0c124161c2df4e5762b918dfcbf142d61ea9a77 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 15 Sep 2013 17:12:51 +0100 Subject: zsh: Optimise pure prompt git checking --- zsh/functions/pure/prompt_pure_setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zsh/functions/pure') diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup index 9c2a752..2cf9101 100644 --- a/zsh/functions/pure/prompt_pure_setup +++ b/zsh/functions/pure/prompt_pure_setup @@ -18,8 +18,8 @@ # 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 -- cgit 1.4.1