Skip to content

Commit 7d18122

Browse files
committed
Merge branch 'jn/gitweb-config-error-die' into maint
* jn/gitweb-config-error-die: gitweb: Die if there are parsing errors in config file
2 parents 6914c66 + e6e592d commit 7d18122

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

gitweb/gitweb.perl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,14 @@ sub filter_snapshot_fmts {
554554
}
555555

556556
our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
557+
our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
558+
# die if there are errors parsing config file
557559
if (-e $GITWEB_CONFIG) {
558560
do $GITWEB_CONFIG;
559-
} else {
560-
our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
561-
do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
561+
die $@ if $@;
562+
} elsif (-e $GITWEB_CONFIG_SYSTEM) {
563+
do $GITWEB_CONFIG_SYSTEM;
564+
die $@ if $@;
562565
}
563566

564567
# Get loadavg of system, to compare against $maxload.

0 commit comments

Comments
 (0)