From 34f20d2cbf651ec2b1366dd2bcbc1331929ac8fc Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 31 Jan 2021 16:11:35 +0000 Subject: [PATCH] zsh/prompt: don't try to populate git prompt if not in git repo Just exit early here, rather than processing anything else. --- zsh/lib/prompt.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zsh/lib/prompt.zsh b/zsh/lib/prompt.zsh index c8ca45b..aaa2694 100644 --- a/zsh/lib/prompt.zsh +++ b/zsh/lib/prompt.zsh @@ -34,6 +34,9 @@ TRAPWINCH() { # Get the status of the working tree git_prompt_status() { + if ! git rev-parse --is-inside-work-tree &>/dev/null; then + return + fi local branch ahead behind local added deleted modified renamed unmerged untracked dirty # Use porcelain status for easy parsing. -- 2.48.1