]> rtime.felk.cvut.cz Git - git.git/commitdiff
Merge branch 'jn/gitweb-patch'
authorJunio C Hamano <gitster@pobox.com>
Mon, 19 Oct 2009 06:01:03 +0000 (23:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Oct 2009 06:01:03 +0000 (23:01 -0700)
* jn/gitweb-patch:
  gitweb: Do not show 'patch' link for merge commits

gitweb/gitweb.perl

index 24b219310a73f6ff8412b9236e7e5a95a7860e2f..c939e2434d5901f0de50c649c5443c026d545a98 100755 (executable)
@@ -5328,7 +5328,7 @@ sub git_commit {
                        } @$parents ) .
                        ')';
        }
-       if (gitweb_check_feature('patches')) {
+       if (gitweb_check_feature('patches') && @$parents <= 1) {
                $formats_nav .= " | " .
                        $cgi->a({-href => href(action=>"patch", -replay=>1)},
                                "patch");
@@ -5616,7 +5616,7 @@ sub git_commitdiff {
                $formats_nav =
                        $cgi->a({-href => href(action=>"commitdiff_plain", -replay=>1)},
                                "raw");
-               if ($patch_max) {
+               if ($patch_max && @{$co{'parents'}} <= 1) {
                        $formats_nav .= " | " .
                                $cgi->a({-href => href(action=>"patch", -replay=>1)},
                                        "patch");
@@ -5824,7 +5824,7 @@ sub git_commitdiff_plain {
 
 # format-patch-style patches
 sub git_patch {
-       git_commitdiff(-format => 'patch', -single=> 1);
+       git_commitdiff(-format => 'patch', -single => 1);
 }
 
 sub git_patches {