120db35b2dd7792b981401f66323e8886668c909

Author
Drarok Ithaqua <github@catchall.drarok.com>
Committer
Drarok Ithaqua <github@catchall.drarok.com>
Date

Message

Fix the backwards svn status, and add comments explaining which way grep does things.

Diff

 1diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
 2index 142ac3bd35b7c67ba324c602a2e3d90b3bc1ce52..79c8bdcdfc28b655c2d81963de1ed5bee5813625 100644
 3--- a/plugins/svn/svn.plugin.zsh
 4+++ b/plugins/svn/svn.plugin.zsh
 5@@ -1,3 +1,4 @@
 6+
 7 function svn_prompt_info {
 8     if [ $(in_svn) ]; then
 9         echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
10@@ -29,9 +30,11 @@ function svn_get_rev_nr {
11 function svn_dirty_choose {
12     if [ $(in_svn) ]; then
13         svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'
14-        if [ $pipestatus[-1] -ne 0 ]; then
15+        if [ $pipestatus[-1] -eq 0 ]; then
16+            # Grep exits with 0 when "One or more lines were selected", return "dirty".
17             echo $1
18         else
19+            # Otherwise, no lines were found, or an error occurred. Return clean.
20             echo $2
21         fi
22     fi