aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Doucette <devin@doucette.cc>2008-12-27 02:39:31 -0700
committerJunio C Hamano <gitster@pobox.com>2008-12-27 22:34:03 -0800
commitfb3bb3d1325f1d0a8cdc402a596c9a520b0ccbe6 (patch)
treea0ea80dba2534b9343806c63831a4e1a16b59ad7
parenta9012e343eee2404a54abcc5bbff9e63f5683029 (diff)
downloadgit-fb3bb3d1325f1d0a8cdc402a596c9a520b0ccbe6.tar.gz
git-fb3bb3d1325f1d0a8cdc402a596c9a520b0ccbe6.tar.xz
gitweb: Fix export check in git_get_projects_list
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>
-rwxr-xr-xgitweb/gitweb.perl5
1 files changed, 3 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8f574c7b3..99f71b47c 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;
}
},