Re: [PATCH 1/3] gitweb: Move check-ref-format code into separate function

2013-12-04 Thread Krzesimir Nowak
On Tue, 2013-12-03 at 20:38 +0100, Jakub Narębski wrote: > On Tue, Dec 3, 2013 at 8:02 PM, Junio C Hamano wrote: > > Krzesimir Nowak writes: > > >> +sub check_ref_format { > >> + my $input = shift || return undef; > >> + > >> + # restrictions on ref name according to git-check-ref-format

Re: [PATCH 1/3] gitweb: Move check-ref-format code into separate function

2013-12-03 Thread Junio C Hamano
Jakub Narębski writes: > Stricly speaking pure refactoring (no functional change, e.g. no assign > to $input) would be "check_ref_format($input) or return undef;", or even > "return check_ref_format($input);" if we keep check_ref_format() passthru > on valid refname. Exactly. -- To unsubscribe

Re: [PATCH 1/3] gitweb: Move check-ref-format code into separate function

2013-12-03 Thread Jakub Narębski
On Tue, Dec 3, 2013 at 8:02 PM, Junio C Hamano wrote: > Krzesimir Nowak writes: >> +sub check_ref_format { >> + my $input = shift || return undef; >> + >> + # restrictions on ref name according to git-check-ref-format >> + if ($input =~ m!(/\.|\.\.|[\000-\040\177 ~^:?*\[]|/$)!) { >>

Re: [PATCH 1/3] gitweb: Move check-ref-format code into separate function

2013-12-03 Thread Junio C Hamano
Krzesimir Nowak writes: > This check will be used in more than one place later. > > Signed-off-by: Krzesimir Nowak > Reviewed-by: Junio C Hamano > Reviewed-by: Jakub Narębski > Reviewed-by: Eric Sunshine > --- > gitweb/gitweb.perl | 17 + > 1 file changed, 13 insertions(+), 4

[PATCH 1/3] gitweb: Move check-ref-format code into separate function

2013-12-03 Thread Krzesimir Nowak
This check will be used in more than one place later. Signed-off-by: Krzesimir Nowak Reviewed-by: Junio C Hamano Reviewed-by: Jakub Narębski Reviewed-by: Eric Sunshine --- gitweb/gitweb.perl | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gitweb/gitweb.p