]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: change call pattern for git_commitdiff
authorGiuseppe Bilotta <redacted>
Thu, 18 Dec 2008 07:13:17 +0000 (08:13 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
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.

Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index e9847469b36a70376e7904c5f1165913f9bb46e6218517d93a698cb4da77dc09..f23a46672ff513dcbd3d6180872ce3a13d04aa134d3dde6ec79c3e9104fed86a 100755 (executable)
@@ -5372,7 +5372,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') {
@@ -5580,12 +5581,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 {
This page took 0.339086 seconds and 4 git commands to generate.