]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
Revert "gitweb: There can be empty patches (in git_patchset_body)"
[Gitweb] / gitweb.perl
index 9d135b77536bc6496c61909ad5143d2f888d7b6a27659caa6f4f70f2b798ab8e..191be31419dbf0b8a3bf4ae6edaea6a72047932911e2fadc4df1896911cb9b0e 100755 (executable)
@@ -2404,7 +2404,7 @@ sub git_patchset_body {
                while ($patch_line = <$fd>) {
                        chomp $patch_line;
 
-                       last EXTENDED_HEADER if ($patch_line =~ m/^--- /);
+                       last EXTENDED_HEADER if ($patch_line =~ m/^--- |^diff /);
 
                        if ($patch_line =~ m/^index ([0-9a-fA-F]{40})..([0-9a-fA-F]{40})/) {
                                $from_id = $1;
@@ -2523,6 +2523,8 @@ sub git_patchset_body {
 
                # from-file/to-file diff header
                $patch_line = $last_patch_line;
+               last PATCH unless $patch_line;
+               next PATCH if ($patch_line =~ m/^diff /);
                #assert($patch_line =~ m/^---/) if DEBUG;
                if ($from{'href'}) {
                        $patch_line = '--- a/' .
@@ -2532,7 +2534,7 @@ sub git_patchset_body {
                print "<div class=\"diff from_file\">$patch_line</div>\n";
 
                $patch_line = <$fd>;
-               last PATCH unless $patch_line;
+               #last PATCH unless $patch_line;
                chomp $patch_line;
 
                #assert($patch_line =~ m/^+++/) if DEBUG;
This page took 0.187909 seconds and 4 git commands to generate.