author | Junio C Hamano <junkio@cox.net> | |
Sun, 5 Nov 2006 01:13:38 +0000 (17:13 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 5 Nov 2006 01:13:38 +0000 (17:13 -0800) |
* pb/web:
gitweb: Support for 'forks'
gitweb: Support for 'forks'
1 | 2 | |||
---|---|---|---|---|
gitweb/gitweb.perl | patch | | diff1 | | diff2 | | blob | history |
diff --cc gitweb/gitweb.perl
index 3759be37b8830ececee270c212a99d1a03f8b9fa,9237184a70041aea63eba304e04977920a71596e..3c6fd7ca47551eb808a40ca2cc7ed1690f19cc06
--- 1/gitweb/gitweb.perl
--- 2/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
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
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);