81004dfaba509ff62a13ba303ab941938d619326

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

2928 merge conflict

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index e1ca9b1138f88255a8a49f3952dfafc85b29ebdd..aba0954222f66c8fafae0f3f3149a36e3a6297e2 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -10,23 +10,20 @@ function git_prompt_info() {
 6 
 7 # Checks if working tree is dirty
 8 parse_git_dirty() {
 9-  local SUBMODULE_SYNTAX=''
10-  local GIT_STATUS=''
11-  local CLEAN_MESSAGE='nothing to commit (working directory clean)'
12-  if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
13+  local STATUS=''
14+  local FLAGS
15+  FLAGS=('--porcelain')
16+  if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then
17     if [[ $POST_1_7_2_GIT -gt 0 ]]; then
18-          SUBMODULE_SYNTAX="--ignore-submodules=dirty"
19+      FLAGS+='--ignore-submodules=dirty'
20     fi
21     if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
22-        GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
23-    else
24-        GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
25-    fi
26-    if [[ -n $GIT_STATUS ]]; then
27-      echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
28-    else
29-      echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
30+      FLAGS+='--untracked-files=no'
31     fi
32+    STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
33+  fi
34+  if [[ -n $STATUS ]]; then
35+    echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
36   else
37     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
38   fi
39@@ -135,17 +132,19 @@ function git_compare_version() {
40   INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
41 
42   for i in {1..3}; do
43+    if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
44+      echo 1
45+      return 0
46+    fi
47     if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
48       echo -1
49       return 0
50     fi
51   done
52-  echo 1
53+  echo 0
54 }
55 
56 #this is unlikely to change so make it all statically assigned
57 POST_1_7_2_GIT=$(git_compare_version "1.7.2")
58 #clean up the namespace slightly by removing the checker function
59 unset -f git_compare_version
60-
61-