Re: [PATCH] gitweb: make feature_blame return a list
- From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- Date
- Dec 15, 2008, 22:52 UTC
- Message-ID
- <gi6n3m$kvc$1@ger.gmane.org>
- In-Reply-To
- <7v7i61w06k.fsf@gitster.siamese.dyndns.org>
On Monday 15 December 2008 23:20, Junio C Hamano wrote:
Show 32 quoted lines
> Matt Kraai <kraai@ftbfs.org> writes:
>
>> The feature defaults are expected to be a list, but feature_blame was
>> returning a scalar. This change makes it consistent with the other
>> boolean feature subroutines.
>>
>> Signed-off-by: Matt Kraai <kraai@ftbfs.org>
>> ---
>> gitweb/gitweb.perl | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index 6eb370d..145e712 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -367,12 +367,12 @@ sub feature_blame {
>> my ($val) = git_get_project_config('blame', '--bool');
>>
>> if ($val eq 'true') {
>> - return 1;
>> + return (1);
>> } elsif ($val eq 'false') {
>> - return 0;
>> + return (0);
>> }
>>
>> - return $_[0];
>> + return ($_[0]);
>> }
>
> My Perl may be getting rusty, but does the above make any difference?
> How?It's formally more correct and makes the blame feature fit with the general feature framework, although the feature works correctly even without the (). I was actually going to send a similar patch myself, having missed it during the cleanup and get/check splitup patchset.
Matt's patch gets my Ack, for what it's worth.
-- Giuseppe "Oblomov" Bilotta