Code

gitweb: Empty patch for merge means trivial merge, not no differences
authorJakub Narebski <jnareb@gmail.com>
Wed, 16 May 2007 22:05:55 +0000 (00:05 +0200)
committerJunio C Hamano <junkio@cox.net>
Wed, 16 May 2007 23:13:42 +0000 (16:13 -0700)
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>
gitweb/gitweb.perl

index 549e0270b6d8a277b20546756d64a639fce9ae99..8c688be66d5a972d57c37031042bd5d56395a079 100755 (executable)
@@ -2877,7 +2877,14 @@ sub git_patchset_body {
        } continue {
                print "</div>\n"; # class="patch"
        }
-       print "<div class=\"diff nodifferences\">No differences found</div>\n" if (!$patch_number);
+
+       if ($patch_number == 0) {
+               if (@hash_parents > 1) {
+                       print "<div class=\"diff nodifferences\">Trivial merge</div>\n";
+               } else {
+                       print "<div class=\"diff nodifferences\">No differences found</div>\n";
+               }
+       }
 
        print "</div>\n"; # class="patchset"
 }