On Thu, 2013-11-28 at 20:13 -0500, Eric Sunshine wrote:
> On Thu, Nov 28, 2013 at 6:44 AM, Krzesimir Nowak <krzesi...@endocode.com> 
> wrote:
> > Allow @additional_branch_refs configuration variable to tell gitweb to
> > show refs from additional hierarchies in addition to branches in the
> > list-of-branches view.
> >
> > Signed-off-by: Krzesimir Nowak <krzesi...@endocode.com>
> > ---
> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> > index 68c77f6..25e1d37 100755
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -680,6 +688,19 @@ sub read_config_file {
> >         return;
> >  }
> >
> > +# performs sanity checks on parts of configuration.
> > +sub config_sanity_check {
> > +       # check additional refs validity
> > +       my %unique_branch_refs = ();
> > +       for my $ref (@additional_branch_refs) {
> > +               die_error(500, "Invalid ref '$ref' in 
> > \@additional_branch_refs") unless (validate_ref($ref));
> > +               # 'heads' are added implicitly in get_branch_refs().
> > +               $unique_branch_refs{$ref} = 1 if ($ref ne 'heads');
> > +       }
> > +       @additional_branch_refs = sort keys %unique_branch_refs;
> > +       %unique_branch_refs = undef;
> > +}
> 
> %unique_branch_refs is going out of scope here, so clearing it seems
> unnecessary.

I am cleaning it in case when more sanity checking code gets added. So
there is no need to keep the data further. 

> 
> Moreover, with warnings enabled, perl should be complaining about an
> "Odd number of elements in hash assignment". (Normally, you would
> clear a hash with '%foo=()' or 'undef %foo'.)
> 

Gah, ok. I'll fix it. Thanks.

> > +
> >  our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM, $GITWEB_CONFIG_COMMON);
> >  sub evaluate_gitweb_config {
> >         our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";

-- 
Krzesimir Nowak
Software Developer
Endocode AG

krzesi...@endocode.com

------
Endocode AG, Johannisstraße 20, 10117 Berlin
i...@endocode.com | www.endocode.com

Vorstandsvorsitzender: Mirko Boehm
Vorstände: Dr. Karl Beecher, Chris Kühl, Sebastian Sucker
Aufsichtsratsvorsitzende: Jennifer Beecher

Registergericht: Amtsgericht Charlottenburg - HRB 150748 B



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to