[PATCH] gitweb: Fix export check in git_get_projects_list
- From
Devin Doucette <devin@doucette.cc>
- Date
- Dec 27, 2008, 09:39 UTC
- Message-ID
- <a899d7ef0812270139u7dd28ee1q45a8c05f7c95db2f@mail.gmail.com>
When $filter was empty, the path passed to check_export_ok would contain an extra '/', which some implementations of export_auth_hook are sensitive to.
It makes more sense to fix this here than to handle the special case in each implementation of export_auth_hook.
Signed-off-by: Devin Doucette <devin@doucette.cc> --- gitweb/gitweb.perl | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 8f574c7..99f71b4 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2147,8 +2147,9 @@ sub git_get_projects_list { my $subdir = substr($File::Find::name, $pfxlen + 1); # we check related file in $projectroot - if (check_export_ok("$projectroot/$filter/$subdir")) { - push @list, { path => ($filter ? "$filter/" : '') . $subdir }; + my $path = ($filter ? "$filter/" : '') . $subdir; + if (check_export_ok("$projectroot/$path")) { + push @list, { path => $path }; $File::Find::prune = 1; } },
-- 1.6.1.rc4