Merge branch 'jn/gitweb-config-error-die'
authorJunio C Hamano <gitster@pobox.com>
Tue, 2 Mar 2010 20:44:11 +0000 (12:44 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Mar 2010 20:44:11 +0000 (12:44 -0800)
* jn/gitweb-config-error-die:
gitweb: Die if there are parsing errors in config file

gitweb/gitweb.perl
index 3c879b88fee39abc8a40cc1ff8e9e6f2652a1e5c..32b04a469e0d3fb824bdcd604fb7051925be62b3 100755 (executable)
@@ -550,11 +550,14 @@ sub filter_snapshot_fmts {
 }
 
 our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
+our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
+# die if there are errors parsing config file
 if (-e $GITWEB_CONFIG) {
        do $GITWEB_CONFIG;
-} else {
-       our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
-       do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
+       die $@ if $@;
+} elsif (-e $GITWEB_CONFIG_SYSTEM) {
+       do $GITWEB_CONFIG_SYSTEM;
+       die $@ if $@;
 }
 
 # Get loadavg of system, to compare against $maxload.