File tree 1 file changed +4
-22
lines changed
1 file changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -13,29 +13,11 @@ find_git_branch() {
13
13
}
14
14
15
15
find_git_dirty () {
16
- if [[ -z " $git_branch " ]]
17
- then
18
- git_dirty=' '
16
+ local status= $( git status --porcelain 2> /dev/null )
17
+ if [[ " $status " != " " ]] ; then
18
+ git_dirty=' * '
19
19
else
20
- # Based on: http://stackoverflow.com/a/2659808/170413
21
- local err
22
- if err=$( git diff-files --quiet 2>&1 )
23
- then
24
- if git diff-index --quiet --cached HEAD
25
- then
26
- git_dirty=' '
27
- else
28
- # Can't figure out different colors
29
- git_dirty=" ^"
30
- fi
31
- elif [ -n " $err " ]
32
- then
33
- # Some error - most likely that it was run within $GIT_DIR
34
- # Resolve repo root instead? `git rev-parse --git-dir` does not work, nor does the 'git root' alias trick
35
- git_dirty=" "
36
- else
37
- git_dirty=" *"
38
- fi
20
+ git_dirty=' '
39
21
fi
40
22
}
41
23
You can’t perform that action at this time.
0 commit comments