]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Fix git_patchset_body not closing <div class="patch">
authorJakub Narebski <redacted>
Tue, 9 Jan 2007 23:07:43 +0000 (00:07 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
Fix case when git_patchset_body didn't close <div class="patch">,
for patchsets with last patch empty.

This patch also removes some commented out code in git_patchset_body.

Signed-off-by: Jakub Narebski <redacted>
Acked-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 357c624b8ec6ba9af39745dba56ee16720baba7b25e6a9f10e6b5e35e55054ff..968643c0b3f6a0b83391f0601f44260c326f8e4c1aebdddc518b1565dfd56d03 100755 (executable)
@@ -2413,7 +2413,6 @@ sub git_patchset_body {
 
                        push @diff_header, $patch_line;
                }
 
                        push @diff_header, $patch_line;
                }
-               #last PATCH unless $patch_line;
                my $last_patch_line = $patch_line;
 
                # check if current patch belong to current raw line
                my $last_patch_line = $patch_line;
 
                # check if current patch belong to current raw line
@@ -2523,7 +2522,10 @@ sub git_patchset_body {
 
                # from-file/to-file diff header
                $patch_line = $last_patch_line;
 
                # from-file/to-file diff header
                $patch_line = $last_patch_line;
-               last PATCH unless $patch_line;
+               if (! $patch_line) {
+                       print "</div>\n"; # class="patch"
+                       last PATCH;
+               }
                next PATCH if ($patch_line =~ m/^diff /);
                #assert($patch_line =~ m/^---/) if DEBUG;
                if ($from{'href'} && $patch_line =~ m!^--- "?a/!) {
                next PATCH if ($patch_line =~ m/^diff /);
                #assert($patch_line =~ m/^---/) if DEBUG;
                if ($from{'href'} && $patch_line =~ m!^--- "?a/!) {
@@ -2534,7 +2536,6 @@ sub git_patchset_body {
                print "<div class=\"diff from_file\">$patch_line</div>\n";
 
                $patch_line = <$fd>;
                print "<div class=\"diff from_file\">$patch_line</div>\n";
 
                $patch_line = <$fd>;
-               #last PATCH unless $patch_line;
                chomp $patch_line;
 
                #assert($patch_line =~ m/^+++/) if DEBUG;
                chomp $patch_line;
 
                #assert($patch_line =~ m/^+++/) if DEBUG;
This page took 0.3396 seconds and 4 git commands to generate.