浏览代码

Merge pull request #1834 from croach/disable_untracked_files_dirty_fix

Adding a fix for the DISABLE_UNTRACKED_FILES_DIRTY option.
Robby Russell 11 年之前
父节点
当前提交
79196f8213
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lib/git.zsh

+ 4 - 4
lib/git.zsh

@@ -15,12 +15,12 @@ parse_git_dirty() {
     if [[ $POST_1_7_2_GIT -gt 0 ]]; then
           SUBMODULE_SYNTAX="--ignore-submodules=dirty"
     fi
-    if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" != "true" ]]; then
-        GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
-    else
+    if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
         GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
+    else
+        GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
     fi
-    if [[ -n $(git status -s ${SUBMODULE_SYNTAX} -uno  2> /dev/null) ]]; then
+    if [[ -n $GIT_STATUS ]]; then
       echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
     else
       echo "$ZSH_THEME_GIT_PROMPT_CLEAN"