From f870f150056bc4f394ff49e273e440b2c30a5154 Mon Sep 17 00:00:00 2001 From: Drarok Ithaqua Date: Wed, 8 May 2013 10:25:58 +0100 Subject: [PATCH] Fix constant errors from svn "svn: '.' is not a working copy" due to incorrect assumptions that svn is sane. --- plugins/svn/svn.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 4f008ba4e..bf8fad616 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -16,10 +16,10 @@ $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_S function in_svn() { - if $(svn info >/dev/null 2>&1); then - return 0 - fi - return 1 + # Subversion doesn't return any exit status for the 'info' command, hence this hack. + # grep will return 0 if 'One or more lines were selected', and Bash treats 0 as true! + svn info 2>&1 | grep -q 'Path:' + return $? } function svn_get_repo_name() {