]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/lib/prompt.zsh
zsh/prompt: don't try to populate git prompt if not in git repo
[dotfiles.git] / zsh / lib / prompt.zsh
index c8ca45b3ce1435c75de87ed83520c9cfa29dd0de..aaa269426a3e0431fd7e13e154d349775bfc8242 100644 (file)
@@ -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.