b2703a3c8a6c860eeea8a36bc693a1508372d8c1

Author
James Moore <james@panic.com>
Committer
James Moore <james@panic.com>
Date

Message

This is the correct way to check the return value

Diff

 1diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
 2index b1f873be541b4541c44685ce635f1883b58cce09..e2cf96ca36acf280cfdb9b6fbf168610f51471fc 100644
 3--- a/plugins/svn/svn.plugin.zsh
 4+++ b/plugins/svn/svn.plugin.zsh
 5@@ -1,5 +1,5 @@
 6 function svn_prompt_info {
 7-    if [[ in_svn == 1 ]]; then
 8+    if [ $(in_svn) ]; then
 9         echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
10 $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
11     fi
12@@ -13,7 +13,7 @@ function in_svn() {
13 }
14 
15 function svn_get_repo_name {
16-    if [ in_svn ]; then
17+    if [ $(in_svn) ]; then
18         svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
19     
20         svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//"
21@@ -21,13 +21,13 @@ function svn_get_repo_name {
22 }
23 
24 function svn_get_rev_nr {
25-    if [ in_svn ]; then
26+    if [ $(in_svn) ]; then
27         svn info 2> /dev/null | sed -n s/Revision:\ //p
28     fi
29 }
30 
31 function svn_dirty_choose {
32-    if [ in_svn ]; then
33+    if [ $(in_svn) ]; then
34         s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null)
35         if [ $s ]; then 
36             echo $1