hg: improve untracked files detection (speed)

This commit is contained in:
Olivier Mengué 2014-01-19 15:05:30 +01:00
parent 7f54e6dee7
commit 35e39d8b50

View File

@ -827,10 +827,8 @@ _lp_hg_branch_color()
if [[ -n "$branch" ]] ; then
local has_untracked
has_untracked=$(hg status 2>/dev/null | grep -c '\(^\?\)')
if [[ -z "$has_untracked" ]] ; then
has_untracked=""
else
has_untracked=
if hg status -u 2>/dev/null | grep -q '^\?' >/dev/null ; then
has_untracked="$LP_COLOR_CHANGES$LP_MARK_UNTRACKED"
fi