[PATCH] gitweb: gitweb_check_feature always return list
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Sep 1, 2006, 19:31 UTC
- Message-ID
- <11571390683018-git-send-email-jnareb@gmail.com>
- In-Reply-To
- <ed8a90$pfn$1@sea.gmane.org>
Modified feature_blame so it returns one-element list and not scalar, thus making gitweb_check_feature always return list. Updated comment to explain that part.
This is continuation of Aneesh Kumar work: gitweb: Fix git_blame "Converting the default values to array broke the git blame enable disable support. Fix the same."
Signed-off-by: Jakub Narebski <jnareb@gmail.com> --- We could modify %feature hash so the 'default' value could be either array reference or a scalar instead.
gitweb/gitweb.perl | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 57ffa25..06bdb0e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -74,9 +74,12 @@ our %feature = ( # # if feature is overridable (it means that allow-override has true value, # then feature-sub will be called with default options as parameters; - # return value of feature-sub indicates if to enable specified feature + # return value of feature-sub indicates if to enable specified feature, + # and is taken to be current parameters of the feature # - # use gitweb_check_feature(<feature>) to check if <feature> is enabled + # use gitweb_check_feature(<feature>) to check if <feature> is enabled; + # to be more exact to get current parameters of <feature>; + # gitweb_check_feature(<feature>) returns array (list) of current options 'blame' => { 'sub' => \&feature_blame, @@ -111,12 +114,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]); } # To disable system wide have in $GITWEB_CONFIG
-- 1.4.1.1