]> Lady’s Gitweb - Gitweb/commitdiff
use do() instead of require() to include configuration
authorDennis Stosberg <redacted>
Tue, 29 Aug 2006 07:19:02 +0000 (09:19 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
When run under mod_perl, require() will read and execute the configuration
file on the first invocation only.  On every subsequent invocation, all
configuration variables will be reset to their default values.  do() reads
and executes the configuration file unconditionally.

Signed-off-by: Dennis Stosberg <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 8ce16d3b1fb8c2a88403064420d2df95580ec55fb8c4bbca7ea0dd567a984b66..4ed90000608e79dda4f879c789e3753fd0db7589356f9de91e4770316b4a61e4 100755 (executable)
@@ -152,7 +152,7 @@ sub feature_snapshot {
 our @diff_opts = ('-M'); # taken from git_commit
 
 our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
 our @diff_opts = ('-M'); # taken from git_commit
 
 our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
-require $GITWEB_CONFIG if -e $GITWEB_CONFIG;
+do $GITWEB_CONFIG if -e $GITWEB_CONFIG;
 
 # version of the core git binary
 our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
 
 # version of the core git binary
 our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
This page took 0.350637 seconds and 4 git commands to generate.