diff options
author | Jakub Narebski <jnareb@gmail.com> | 2009-10-09 14:26:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-10-09 14:57:06 -0700 |
commit | 1655c98790682aed8892eb8a9eb6d44e00d5f69f (patch) | |
tree | da0f54787dcb7c1841ae70bb31fc7cfecd933bd3 /gitweb | |
parent | 1be224ba6e99f0ab34c998d7fa8023b76a15c8b6 (diff) | |
download | git-1655c98790682aed8892eb8a9eb6d44e00d5f69f.tar.gz |
gitweb: Do not show 'patch' link for merge commits
The 'patch' view is about generating text/plain patch that can be
given to "git am", and "git am" doesn't understand merges anyway.
Therefore link to 'patch' view should not be shown for merge commits.
Also call to git-format-patch inside the 'patch' action would fail
when 'patch' action is called for a merge commit, with "Reading
git-format-patch failed" text as 'patch' view body.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 24b219310a..c939e2434d 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -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 { |