From: Junio C Hamano Date: Sun, 5 Nov 2006 01:13:38 +0000 (-0800) Subject: Merge branch 'pb/web' X-Git-Tag: v1.4.4-rc1~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9004dcbe8278b6d66f41e6e401f6d564a64fd1e1;p=git.git Merge branch 'pb/web' * pb/web: gitweb: Support for 'forks' --- 9004dcbe8278b6d66f41e6e401f6d564a64fd1e1 diff --cc gitweb/gitweb.perl index 3759be37b,9237184a7..3c6fd7ca4 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@@ -897,15 -912,19 +913,21 @@@ sub git_get_project_url_list } sub git_get_projects_list { + my ($filter) = @_; my @list; + $filter ||= ''; + $filter =~ s/\.git$//; + if (-d $projects_list) { # search in directory - my $dir = $projects_list; + my $dir = $projects_list . ($filter ? "/$filter" : ''); + # remove the trailing "/" + $dir =~ s!/+$!!; my $pfxlen = length("$dir"); + my $check_forks = gitweb_check_feature('forks'); + File::Find::find({ follow_fast => 1, # follow symbolic links dangling_symlinks => 0, # ignore dangling symlinks, silently @@@ -2529,9 -2572,22 +2610,13 @@@ sub git_summary my $owner = git_get_project_owner($project); - my ($reflist, $refs) = git_get_refs_list(); - - my @taglist; - my @headlist; - foreach my $ref (@$reflist) { - if ($ref->{'name'} =~ s!^heads/!!) { - push @headlist, $ref; - } else { - $ref->{'name'} =~ s!^tags/!!; - push @taglist, $ref; - } - } + my $refs = git_get_references(); + my @taglist = git_get_tags_list(15); + my @headlist = git_get_heads_list(15); + my @forklist; + if (gitweb_check_feature('forks')) { + @forklist = git_get_projects_list($project); + } git_header_html(); git_print_page_nav('summary','', $head);