From: Petr Baudis Date: Sat, 8 Dec 2007 11:30:59 +0000 (+0100) Subject: gitweb: Make config_to_multi return [] instead of [undef] X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/f4846479c08158cd8abbea222ced6449d9ed25fc0b7964988eded94b9f9775f4 gitweb: Make config_to_multi return [] instead of [undef] This is important for the list of clone urls, where if there are no per-repository clone URL configured, the default base URLs are never used for URL construction without this patch. Add tests for different ways of setting project URLs, just in case. Note that those tests in current form wouldn't detect breakage fixed by this patch, as it only checks for errors and not for expected output. Signed-off-by: Petr Baudis Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 2abb43d..0eb4fb1 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -1512,7 +1512,7 @@ sub config_to_int { sub config_to_multi { my $val = shift; - return ref($val) ? $val : [ $val ]; + return ref($val) ? $val : (defined($val) ? [ $val ] : []); } sub git_get_project_config {