Avoid running svn info twice, and avoid matching the "Relative URL" line in its output.

This commit is contained in:
Drarok Ithaqua 2013-09-23 10:09:56 +01:00
commit acf16c90c3

View file

@ -24,8 +24,9 @@ function in_svn() {
function svn_get_repo_name() {
if in_svn; then
svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
SVN_INFO=$(svn info)
echo $SVN_INFO | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
echo $SVN_INFO | sed -n "s/^URL:\ .*$SVN_ROOT\///p"
fi
}
@ -43,7 +44,7 @@ function svn_get_branch_name() {
} \
}'
)
if [ "x$_DISPLAY" = "x" ]; then
svn_get_repo_name
else