From: Giuseppe Bilotta Date: Thu, 18 Dec 2008 07:13:17 GMT Subject: [PATCHv6 2/4] gitweb: change call pattern for git_commitdiff Message-ID: <1229584399-23879-3-git-send-email-giuseppe.bilotta@gmail.com> In-Reply-To: <1229584399-23879-2-git-send-email-giuseppe.bilotta@gmail.com> Since we are going to introduce an additional parameter for git_commitdiff to tune patch view, we switch to named/hash-based parameter passing for clarity and robustness. --- gitweb/gitweb.perl | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 1006dfe..18d43e7 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5412,7 +5412,8 @@ sub git_blobdiff_plain { } sub git_commitdiff { - my $format = shift || 'html'; + my %params = @_; + my $format = $params{-format} || 'html'; my $patch_max; if ($format eq 'patch') { @@ -5620,12 +5621,12 @@ sub git_commitdiff { } sub git_commitdiff_plain { - git_commitdiff('plain'); + git_commitdiff(-format => 'plain'); } # format-patch-style patches sub git_patch { - git_commitdiff('patch'); + git_commitdiff(-format => 'patch'); } sub git_history { -- 1.5.6.5