Skip to content

Commit

Permalink
gitweb: Fix export check in git_get_projects_list
Browse files Browse the repository at this point in the history
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>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Devin Doucette authored and Junio C Hamano committed Dec 28, 2008
1 parent a9012e3 commit fb3bb3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},
Expand Down

0 comments on commit fb3bb3d

Please sign in to comment.