gitweb: Refactor checking if part of project info need filling
commit14b289bdf7c31176dc525cbe81173ec636598782
authorJakub Narebski <jnareb@gmail.com>
Thu, 23 Feb 2012 15:54:46 +0000 (23 16:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Feb 2012 20:49:37 +0000 (23 12:49 -0800)
tree8c17e005f4d74f5d630d05afccf338e513b678c1
parentb0d66b5110faaeb395610ba43b6eb70a18ab5e25
gitweb: Refactor checking if part of project info need filling

Extract the check if given keys (given parts) of project info needs to
be filled into project_info_needs_filling() subroutine.  It is for now
a thin wrapper around "!exists $project_info->{$key}".

Note that !defined was replaced by more correct !exists.

While at it uniquify treating of all project info, adding checks for
'age' field before running git_get_last_activity(), and also checking
for all keys filled in code protected by conditional, and not only
one.

The code now looks like this

  foreach my $project (@$project_list) {
   if (given keys need to be filled) {
   fill given keys
   }
   ...
  }

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl