caio.co/de/bash.d

vcsinfo:git: There is no such a thing as `0` being falsy

Id
88978416e125324c2dad75057f32006f29b6a0f8
Author
Caio
Commit time
2014-06-05T21:32:21-03:00

Modified lib/vcsinfo.sh

@@ -33,13 +33,13
# yellow => index modified (has precedence over red)
# red => worktree modified
local state="${GREEN}"
- if [[ ${git_status} =~ $'\n'?(M|D|\?) ]]; then
+ if [[ ${git_status} =~ $'\n'.(M|D|\?) ]]; then
state="${RED}"
is_dirty=1
fi
if [[ ${git_status} =~ $'\n'(M|A|R|C|D) ]]; then
state="${YELLOW}"
- test $is_dirty && dirty_flag="${BLUE}!"
+ test $is_dirty -eq 1 && dirty_flag="${BLUE}!"
fi

local remote=""