]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: fix disabling of "forks"
authorJunio C Hamano <redacted>
Wed, 8 Nov 2006 06:00:45 +0000 (22:00 -0800)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
gitweb.perl

index d8b50debf19167cf2d4ec10c2885dd8990aed908d693670e261b15f23d8bf56d..fbee2c1e2bdc776b894ce1925aea5a497f541ddf14f66e81eab6af15d3c0bf3a 100755 (executable)
@@ -927,7 +927,7 @@ sub git_get_projects_list {
                $dir =~ s!/+$!!;
                my $pfxlen = length("$dir");
 
                $dir =~ s!/+$!!;
                my $pfxlen = length("$dir");
 
-               my $check_forks = gitweb_check_feature('forks');
+               my ($check_forks) = gitweb_check_feature('forks');
 
                File::Find::find({
                        follow_fast => 1, # follow symbolic links
 
                File::Find::find({
                        follow_fast => 1, # follow symbolic links
@@ -2213,7 +2213,7 @@ sub git_patchset_body {
 sub git_project_list_body {
        my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
 
 sub git_project_list_body {
        my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
 
-       my $check_forks = gitweb_check_feature('forks');
+       my ($check_forks) = gitweb_check_feature('forks');
 
        my @projects;
        foreach my $pr (@$projlist) {
 
        my @projects;
        foreach my $pr (@$projlist) {
@@ -2615,7 +2615,9 @@ sub git_summary {
        my @taglist  = git_get_tags_list(15);
        my @headlist = git_get_heads_list(15);
        my @forklist;
        my @taglist  = git_get_tags_list(15);
        my @headlist = git_get_heads_list(15);
        my @forklist;
-       if (gitweb_check_feature('forks')) {
+       my ($check_forks) = gitweb_check_feature('forks');
+
+       if ($check_forks) {
                @forklist = git_get_projects_list($project);
        }
 
                @forklist = git_get_projects_list($project);
        }
 
This page took 0.217638 seconds and 4 git commands to generate.