[PATCH 1/2] gitweb: allow access to forks with strict_export

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



git_get_projects_list excludes forks in order to unclutter the main
project list, but this caused the strict_export check, which also relies
on git_get_project_list, to incorrectly fail for forks.  This patch adds
an argument so git_get_projects_list knows when it is being called for a
strict_export check (as opposed to a user-visible project list) and
doesn't exclude the forks.

Signed-off-by: Matt McCutchen <matt@xxxxxxxxxxxxxxxxx>
---
 gitweb/gitweb.perl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 86511cf..5357bcc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1144,7 +1144,8 @@ sub untabify {
 
 sub project_in_list {
 	my $project = shift;
-	my @list = git_get_projects_list();
+	# Tell git_get_projects_list to include forks.
+	my @list = git_get_projects_list(undef, 1);
 	return @list && scalar(grep { $_->{'path'} eq $project } @list);
 }
 
@@ -2128,13 +2129,13 @@ sub git_get_project_url_list {
 }
 
 sub git_get_projects_list {
-	my ($filter) = @_;
+	my ($filter, $for_strict_export) = @_;
 	my @list;
 
 	$filter ||= '';
 	$filter =~ s/\.git$//;
 
-	my $check_forks = gitweb_check_feature('forks');
+	my $check_forks = !$for_strict_export && gitweb_check_feature('forks');
 
 	if (-d $projects_list) {
 		# search in directory
-- 
1.6.1.rc2.27.gc7114


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux