mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-23 21:01:58 +00:00
Fix the backwards svn status, and add comments explaining which way grep does things.
This commit is contained in:
parent
79e620c392
commit
120db35b2d
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
|
||||
function svn_prompt_info {
|
||||
if [ $(in_svn) ]; then
|
||||
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
|
||||
|
@ -29,9 +30,11 @@ function svn_get_rev_nr {
|
|||
function svn_dirty_choose {
|
||||
if [ $(in_svn) ]; then
|
||||
svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'
|
||||
if [ $pipestatus[-1] -ne 0 ]; then
|
||||
if [ $pipestatus[-1] -eq 0 ]; then
|
||||
# Grep exits with 0 when "One or more lines were selected", return "dirty".
|
||||
echo $1
|
||||
else
|
||||
# Otherwise, no lines were found, or an error occurred. Return clean.
|
||||
echo $2
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue