Skip to content

Commit

Permalink
lib-git-svn.sh: Avoid setting web server variables unnecessarily
Browse files Browse the repository at this point in the history
If the SVN_HTTPD_PORT variable is not set, then we will not even
attempt to start a web server in the start_httpd function (despite
it's name), so there is no need to determine values for the
SVN_HTTPD_PATH and SVN_HTTPD_MODULE_PATH variables.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Dec 14, 2010
1 parent 531dd7b commit b6fe974
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions t/lib-git-svn.sh
Original file line number Diff line number Diff line change
@@ -68,28 +68,31 @@ svn_cmd () {
svn "$orig_svncmd" --config-dir "$svnconf" "$@"
}

for d in \
"$SVN_HTTPD_PATH" \
/usr/sbin/apache2 \
/usr/sbin/httpd \
; do
if test -f "$d"
then
SVN_HTTPD_PATH="$d"
break
fi
done
for d in \
"$SVN_HTTPD_MODULE_PATH" \
/usr/lib/apache2/modules \
/usr/libexec/apache2 \
; do
if test -d "$d"
then
SVN_HTTPD_MODULE_PATH="$d"
break
fi
done
if test -n "$SVN_HTTPD_PORT"
then
for d in \
"$SVN_HTTPD_PATH" \
/usr/sbin/apache2 \
/usr/sbin/httpd \
; do
if test -f "$d"
then
SVN_HTTPD_PATH="$d"
break
fi
done
for d in \
"$SVN_HTTPD_MODULE_PATH" \
/usr/lib/apache2/modules \
/usr/libexec/apache2 \
; do
if test -d "$d"
then
SVN_HTTPD_MODULE_PATH="$d"
break
fi
done
fi

start_httpd () {
repo_base_path="$1"

0 comments on commit b6fe974

Please sign in to comment.