summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorBernhard R. Link <brl+git@mail.brlink.eu>2012-01-30 21:05:47 +0100
committerJunio C Hamano <gitster@pobox.com>2012-02-01 12:52:33 -0800
commit4c7cd177148c0ae018e1f1d1c037d296d50d3562 (patch)
tree96c26ea2ac39173baf200faaec6b97dc5ebb10b5 /gitweb
parent828ea97de486c1693d6e4f2c7347acb50235a85d (diff)
downloadgit-4c7cd177148c0ae018e1f1d1c037d296d50d3562.tar.gz
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 <brlink@debian.org> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl10
1 files changed, 6 insertions, 4 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index abb5a79afc..e074cd7c63 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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;
@@ -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");
}
@@ -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);