Skip to content

Commit 4c7cd17

Browse files
Bernhard R. Linkgitster
authored andcommitted
gitweb: move hard coded .git suffix out of git_get_projects_list
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 <[email protected]> Acked-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 828ea97 commit 4c7cd17

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

gitweb/gitweb.perl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,8 +2829,6 @@ sub git_get_projects_list {
28292829
my $filter = shift || '';
28302830
my @list;
28312831

2832-
$filter =~ s/\.git$//;
2833-
28342832
if (-d $projects_list) {
28352833
# search in directory
28362834
my $dir = $projects_list;
@@ -6005,7 +6003,9 @@ sub git_forks {
60056003
die_error(400, "Unknown order parameter");
60066004
}
60076005

6008-
my @list = git_get_projects_list($project);
6006+
my $filter = $project;
6007+
$filter =~ s/\.git$//;
6008+
my @list = git_get_projects_list($filter);
60096009
if (!@list) {
60106010
die_error(404, "No forks found");
60116011
}
@@ -6064,7 +6064,9 @@ sub git_summary {
60646064

60656065
if ($check_forks) {
60666066
# find forks of a project
6067-
@forklist = git_get_projects_list($project);
6067+
my $filter = $project;
6068+
$filter =~ s/\.git$//;
6069+
@forklist = git_get_projects_list($filter);
60686070
# filter out forks of forks
60696071
@forklist = filter_forks_from_projects_list(\@forklist)
60706072
if (@forklist);

0 commit comments

Comments
 (0)