1. Stefan Saasen
  2. git

Commits

Junio C Hamano  committed 7d18122 Merge

Merge branch 'jn/gitweb-config-error-die' into maint

* jn/gitweb-config-error-die:
gitweb: Die if there are parsing errors in config file

  • Participants
  • Parent commits 6914c66, e6e592d
  • Branches master

Comments (0)

Files changed (1)

File gitweb/gitweb.perl

View file
  • Ignore whitespace
 }
 
 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.