gitweb: fix disabling of "forks"
Apparently this code was never tested without "forks". check-feature returns a one-element list (0) when disabled, and assigning that to a scalar variable made it to be called in a scalar context, which meant my $check_forks = gitweb_check_feature("forks") were always 1! Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Nov 7, 2006 at 22:00 UTC
5dd5ed09fe6b5508cf29dd1dbf40bea2f0d16ad3
1 file changed
+5
-3
gitweb/gitweb.perl
+5
-3
@@ -926,7 +926,7 @@ sub git_get_projects_list {
926
$dir =~ s!/+$!!;
927
my $pfxlen = length("$dir");
928
929
- my $check_forks = gitweb_check_feature('forks');
929
+ my ($check_forks) = gitweb_check_feature('forks');
930
931
File::Find::find({
932
follow_fast => 1, # follow symbolic links
@@ -2212,7 +2212,7 @@ sub git_patchset_body {
2212
sub git_project_list_body {
2213
my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
2214
2215
- my $check_forks = gitweb_check_feature('forks');
2215
+ my ($check_forks) = gitweb_check_feature('forks');
2216
2217
my @projects;
2218
foreach my $pr (@$projlist) {
@@ -2614,7 +2614,9 @@ sub git_summary {
2614
my @taglist = git_get_tags_list(15);
2615
my @headlist = git_get_heads_list(15);
2616
my @forklist;
2617
- if (gitweb_check_feature('forks')) {
2617
+ my ($check_forks) = gitweb_check_feature('forks');
2618
+
2619
+ if ($check_forks) {
2620
@forklist = git_get_projects_list($project);
2621
}
2622