Skip to content

Commit

Permalink
gitweb: move hard coded .git suffix out of git_get_projects_list
Browse files Browse the repository at this point in the history
Use of the filter option of git_get_projects_list is currently
limited to forks. It hard codes removal of ".git" suffixes from
the filter.

To make it more generic move the .git suffix removal to the callers.

Signed-off-by: Bernhard R. Link <brlink@debian.org>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Bernhard R. Link authored and Junio C Hamano committed Feb 1, 2012
1 parent 828ea97 commit 4c7cd17
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2829,8 +2829,6 @@ sub git_get_projects_list {
my $filter = shift || '';
my @list;

$filter =~ s/\.git$//;

if (-d $projects_list) {
# search in directory
my $dir = $projects_list;
Expand Down Expand Up @@ -6005,7 +6003,9 @@ sub git_forks {
die_error(400, "Unknown order parameter");
}

my @list = git_get_projects_list($project);
my $filter = $project;
$filter =~ s/\.git$//;
my @list = git_get_projects_list($filter);
if (!@list) {
die_error(404, "No forks found");
}
Expand Down Expand Up @@ -6064,7 +6064,9 @@ sub git_summary {

if ($check_forks) {
# find forks of a project
@forklist = git_get_projects_list($project);
my $filter = $project;
$filter =~ s/\.git$//;
@forklist = git_get_projects_list($filter);
# filter out forks of forks
@forklist = filter_forks_from_projects_list(\@forklist)
if (@forklist);
Expand Down

0 comments on commit 4c7cd17

Please sign in to comment.