gitweb: Make config_to_multi return [] instead of [undef]
PATCH 1/1 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 with this patch.
---
gitweb/gitweb.perl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
gitweb/gitweb.perl +1 -1
@@ -1512,7 +1512,7 @@ sub config_to_int { sub config_to_multi { my $val = shift; - return ref($val) ? $val : [ $val ]; + return ref($val) ? $val : $val ? [ $val ] : []; } sub git_get_project_config {
Quoted 3 lines · Petr Baudis
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 with this patch.
Thanks.
gitweb/gitweb.perl sub config_to_int { · line 1516
Quoted 7 lines
gitweb/gitweb.perl +1
-1@@ -1512,7 +1512,7 @@ sub config_to_int { sub config_to_multi { my $val = shift; - return ref($val) ? $val : [ $val ]; + return ref($val) ? $val : $val ? [ $val ] : []; }
Shouldn't it be
+ return ref($val) ? $val : defined($val) ? [ $val ] : [];
Signature · 1 line
Jakub Narebski
Quoted 12 lines · Jakub Narebski
Quoted 3 lines · Petr Baudis
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 with this patch.
Thanks.
Quoted 4 lines
gitweb/gitweb.perl +0
-0@@ -1512,7 +1512,7 @@ sub config_to_int { sub config_to_multi { my $val = shift;
Quoted 7 lines
gitweb/gitweb.perl sub config_to_int { · line 1516
Quoted 3 lines
gitweb/gitweb.perl +1
-1- return ref($val) ? $val : [ $val ]; + return ref($val) ? $val : $val ? [ $val ] : []; }Shouldn't it be
+ return ref($val) ? $val : defined($val) ? [ $val ] : [];
I think so. Pasky?