summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2010-04-30 16:30:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-01 19:40:12 (GMT)
commitee1d8ee0f0f3faaa72f5c4886e61befaf7915718 (patch)
tree44ef31a956565b2756bb38cba71b90bac4768f6f /gitweb
parentca5e9495607c2abb4b665b75d3d96a457fa4c5dd (diff)
downloadgit-ee1d8ee0f0f3faaa72f5c4886e61befaf7915718.zip
git-ee1d8ee0f0f3faaa72f5c4886e61befaf7915718.tar.gz
git-ee1d8ee0f0f3faaa72f5c4886e61befaf7915718.tar.bz2
gitweb: Silence 'Variable VAR may be unavailable' warnings
When $projects_list points to a directory, and git_get_projects_list scans this directory for repositories, there can be generated the following warnings (for persistent services like mod_perl or plackup): Variable "$project_maxdepth" may be unavailable at gitweb.cgi line 2443. Variable "$projectroot" may be unavailable at gitweb.cgi line 2451. Those are false positives; silence those warnings by explicitely declaring $project_maxdepth and $projectroot with 'our', as global variables, in anonymous subrotine passed to File::Find::find. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 3 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 48e21da..64eaa75 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1520,6 +1520,9 @@ sub git_get_projects_list {
follow_skip => 2, # ignore duplicates
dangling_symlinks => 0, # ignore dangling symlinks, silently
wanted => sub {
+ # global variables
+ our $project_maxdepth;
+ our $projectroot;
# skip project-list toplevel, if we get it.
return if (m!^[/.]$!);
# only directories can be git repositories