From 19887ae9ccd581a915f8cae63cd1df01d63eea4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juh=C3=A1sz=20P=C3=A9ter?= Date: Sat, 23 Nov 2013 22:09:32 +0100 Subject: [PATCH] -Fix: suppress svnversion's stderr, return on error --- git-prompt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 04d6748..522b3cb 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -763,8 +763,9 @@ parse_svn_status() { local svn_info_str myrc rev case $svn_method in - svnversion) rev=$(svnversion) - [[ "$rev" == "exported" || "$rev" =~ "Unversioned" ]] && return 1 + svnversion) rev=$(svnversion 2> /dev/null) + myrc=$? + [[ $myrc -ne 0 || "$rev" == "exported" || "$rev" =~ "Unversioned" ]] && return 1 ;; info) svn_info_str=$(svn info 2> /dev/null) @@ -776,6 +777,8 @@ parse_svn_status() { dotsvn) [[ -d .svn ]] || return 1 svn_info_str=$(svn info 2> /dev/null) + myrc=$? + [[ $myrc -eq 0 ]] || return 1 rev=${svn_info_str##*Revision: } rev=${rev%%[[:space:]]*} ;;