Skip to content

Commit

Permalink
-Fix: suppress svnversion's stderr, return on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Juhász Péter committed Nov 23, 2013
1 parent 483e77d commit 19887ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:]]*}
;;
Expand Down

0 comments on commit 19887ae

Please sign in to comment.