From c1de05a8a559827bd5f8f2b037c9e680a9c802fe Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Thu, 21 Jan 2010 08:40:26 +0530 Subject: [PATCH] doc/3: gitweb integ; trailing slash on $projectroot It's not clear whether $projectroot has or does not have a trailing slash. Current code assumes it does, but we need to cater for it not having one also. Otherwise the final reponame ends up with a leading slash, once $projectroot has been stripped from the beginning of the full repo path. --- doc/3-faq-tips-etc.mkd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/3-faq-tips-etc.mkd b/doc/3-faq-tips-etc.mkd index a7ee05a..572d06c 100644 --- a/doc/3-faq-tips-etc.mkd +++ b/doc/3-faq-tips-etc.mkd @@ -347,7 +347,7 @@ already done and we just use it! $export_auth_hook = sub { my $reponame = shift; # gitweb passes us the full repo path; so we strip the beginning... - $reponame =~ s/\Q$projectroot//; + $reponame =~ s/\Q$projectroot\E\/?//; # ...and the end, to get the repo name as it is specified in gitolite conf $reponame =~ s/\.git$//;