]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Check git base URLs before generating URL from it
authorJakub Narebski <redacted>
Thu, 26 Oct 2006 10:26:44 +0000 (12:26 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
Check if each of git base URLs in @git_base_url_list is true before
appending "/$project" to it to generate project URL.

This fixes the error that for default configuration for gitweb in
Makefile, with GITWEB_BASE_URL empty (and "++GITWEB_BASE_URL++" being
"" in gitweb.cgi), we had URL of "/$project" in the summary view.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 71068ddc3c43457c59d5e469dd6a43db7bd1f9729c1b0fdd301ce6a6d6df7b8f..c2b70fa0f9a7256b7cc84ce455d34d4e4f8c8c5068dc48c0e34149c386a9c2b2 100755 (executable)
@@ -78,7 +78,7 @@ our $strict_export = "++GITWEB_STRICT_EXPORT++";
 
 # list of git base URLs used for URL to where fetch project from,
 # i.e. full URL is "$git_base_url/$project"
-our @git_base_url_list = ("++GITWEB_BASE_URL++");
+our @git_base_url_list = grep { $_ ne '' } ("++GITWEB_BASE_URL++");
 
 # default blob_plain mimetype and default charset for text/plain blob
 our $default_blob_plain_mimetype = 'text/plain';
This page took 0.254989 seconds and 4 git commands to generate.