浏览代码

makes git status prompt 4x faster

(via git status -s, benchmarked)
Andy Fowler 14 年之前
父节点
当前提交
3c87d48362
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/git.zsh

+ 1 - 1
lib/git.zsh

@@ -5,7 +5,7 @@ function git_prompt_info() {
 }
 
 parse_git_dirty () {
-  if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
+  if [[ -n $(git status -s 2> /dev/null) ]]; then
     echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
   else
     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"