Skip to content

Commit

Permalink
gitweb: Empty patch for merge means trivial merge, not no differences
Browse files Browse the repository at this point in the history
Earlier commit 4280cde 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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed May 16, 2007
1 parent fdcb769 commit d26c426
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit d26c426

Please sign in to comment.