Skip to content

Commit

Permalink
gitweb: Silence 'Variable VAR may be unavailable' warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
jnareb authored and gitster committed May 1, 2010
1 parent ca5e949 commit ee1d8ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee1d8ee

Please sign in to comment.