mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Added support for DISABLE_UNTRACKED_FILES_DIRTY
When DISABLE_UNTRACKED_FILES_DIRTY is true, add --quiet flag to hg status command. This effectively disables untracted fiels form the durty check.
This commit is contained in:
parent
d848c94804
commit
2bc695a430
1 changed files with 5 additions and 1 deletions
|
|
@ -40,8 +40,12 @@ $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_PROMPT_BASE_COLOR$
|
||||||
}
|
}
|
||||||
|
|
||||||
function hg_dirty_choose {
|
function hg_dirty_choose {
|
||||||
|
local FLAGS
|
||||||
if [ $(in_hg) ]; then
|
if [ $(in_hg) ]; then
|
||||||
hg status 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'
|
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
|
||||||
|
FLAGS+='--quiet'
|
||||||
|
fi
|
||||||
|
hg status ${FLAGS} 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'
|
||||||
if [ $pipestatus[-1] -eq 0 ]; then
|
if [ $pipestatus[-1] -eq 0 ]; then
|
||||||
# Grep exits with 0 when "One or more lines were selected", return "dirty".
|
# Grep exits with 0 when "One or more lines were selected", return "dirty".
|
||||||
echo $1
|
echo $1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue