Return early if folder isn't a git repo
Minor performance improvement
This commit is contained in:
@@ -34,6 +34,7 @@ zstyle ':vcs_info:git*' actionformats ' %b|%a'
|
|||||||
|
|
||||||
# Fastest possible way to check if repo is dirty
|
# Fastest possible way to check if repo is dirty
|
||||||
git_dirty() {
|
git_dirty() {
|
||||||
|
[ -d .git ] || return
|
||||||
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo '*'
|
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo '*'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user