We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c729611 commit b874b75Copy full SHA for b874b75
prompt.sh
@@ -13,29 +13,11 @@ find_git_branch() {
13
}
14
15
find_git_dirty() {
16
- if [[ -z "$git_branch" ]]
17
- then
18
- git_dirty=''
+ local status=$(git status --porcelain 2> /dev/null)
+ if [[ "$status" != "" ]]; then
+ git_dirty='*'
19
else
20
- # Based on: http://stackoverflow.com/a/2659808/170413
21
- local err
22
- if err=$(git diff-files --quiet 2>&1)
23
24
- if git diff-index --quiet --cached HEAD
25
26
27
- else
28
- # Can't figure out different colors
29
- git_dirty="^"
30
- fi
31
- elif [ -n "$err" ]
32
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
37
- git_dirty="*"
38
+ git_dirty=''
39
fi
40
41
0 commit comments