@@ -10,23 +10,20 @@ function git_prompt_info() {
10
10
11
11
# Checks if working tree is dirty
12
12
parse_git_dirty () {
13
- local SUBMODULE_SYNTAX =' '
14
- local GIT_STATUS= ' '
15
- local CLEAN_MESSAGE= ' nothing to commit (working directory clean) '
16
- 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
17
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
18
- SUBMODULE_SYNTAX= " --ignore-submodules=dirty"
18
+ FLAGS+= ' --ignore-submodules=dirty'
19
19
fi
20
20
if [[ " $DISABLE_UNTRACKED_FILES_DIRTY " == " true" ]]; then
21
- GIT_STATUS=$( command git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
22
- else
23
- GIT_STATUS=$( command git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
24
- fi
25
- if [[ -n $GIT_STATUS ]]; then
26
- echo " $ZSH_THEME_GIT_PROMPT_DIRTY "
27
- else
28
- echo " $ZSH_THEME_GIT_PROMPT_CLEAN "
21
+ FLAGS+=' --untracked-files=no'
29
22
fi
23
+ STATUS=$( command git status ${FLAGS} 2> /dev/null | tail -n1)
24
+ fi
25
+ if [[ -n $STATUS ]]; then
26
+ echo " $ZSH_THEME_GIT_PROMPT_DIRTY "
30
27
else
31
28
echo " $ZSH_THEME_GIT_PROMPT_CLEAN "
32
29
fi
@@ -135,17 +132,19 @@ function git_compare_version() {
135
132
INSTALLED_GIT_VERSION=(${(s/ ./ )INSTALLED_GIT_VERSION[3]} );
136
133
137
134
for i in {1..3}; do
135
+ if [[ $INSTALLED_GIT_VERSION [$i ] -gt $INPUT_GIT_VERSION [$i ] ]]; then
136
+ echo 1
137
+ return 0
138
+ fi
138
139
if [[ $INSTALLED_GIT_VERSION [$i ] -lt $INPUT_GIT_VERSION [$i ] ]]; then
139
140
echo -1
140
141
return 0
141
142
fi
142
143
done
143
- echo 1
144
+ echo 0
144
145
}
145
146
146
147
# this is unlikely to change so make it all statically assigned
147
148
POST_1_7_2_GIT=$( git_compare_version " 1.7.2" )
148
149
# clean up the namespace slightly by removing the checker function
149
150
unset -f git_compare_version
150
-
151
-
2 commit comments
javache commentedon Nov 19, 2014
Wait, this undos the change in #2323 again :(
mcornella commentedon Nov 19, 2014
S****, sorry! I posted PR #3333 to fix it once and for all