@matheusbsbs / matheus-bagliano / commits / d26c4264e5
Fork 0

gitweb: Empty patch for merge means trivial merge, not no differences

Earlier commit 4280cde95fa4e3fb012eb6d0c239a7777baaf60c made gitweb show "No differences found" message for empty diff, for the HTML output. But for merge commits, either -c format we use or --cc format, empty diff doesn't mean no differences, but trivial merge. Show "Trivial merge" message instead of "No differences found" for merges. While at it reword conditional in the code for easier reading. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed May 17, 2007 at 00:05 UTC d26c4264e584a1a8cbadbc161fa52cf947f5230a
1 file changed +8 -1
gitweb/gitweb.perl
+8 -1
@@ -2877,7 +2877,14 @@ sub git_patchset_body {
2877 } continue {
2878 print "</div>\n"; # class="patch"
2879 }
2880 - print "<div class=\"diff nodifferences\">No differences found</div>\n" if (!$patch_number);
2880 +
2881 + if ($patch_number == 0) {
2882 + if (@hash_parents > 1) {
2883 + print "<div class=\"diff nodifferences\">Trivial merge</div>\n";
2884 + } else {
2885 + print "<div class=\"diff nodifferences\">No differences found</div>\n";
2886 + }
2887 + }
2888
2889 print "</div>\n"; # class="patchset"
2890 }