summaryrefslogtreecommitdiffstats
path: root/extensions/Splinter/lib
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-07-12 16:44:03 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-07-12 16:44:03 +0200
commitdc519b098fac5c18b3807e8a7dfd37334799c951 (patch)
treeadfca05db74f5f84399520f147bc10ba786c51f1 /extensions/Splinter/lib
parentb823202cd93b41b0cf68776a42825f8943f7d7e0 (diff)
downloadbugzilla-dc519b098fac5c18b3807e8a7dfd37334799c951.tar.gz
bugzilla-dc519b098fac5c18b3807e8a7dfd37334799c951.tar.xz
Bug 1283649 - When an attachment is a github pull request link, the pull request diff should be displayed in the edit page
Diffstat (limited to 'extensions/Splinter/lib')
-rw-r--r--extensions/Splinter/lib/Util.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/extensions/Splinter/lib/Util.pm b/extensions/Splinter/lib/Util.pm
index 870e67be7..6421d2f0b 100644
--- a/extensions/Splinter/lib/Util.pm
+++ b/extensions/Splinter/lib/Util.pm
@@ -78,8 +78,9 @@ sub attachment_is_visible {
sub attachment_id_is_patch {
my $attach_id = shift;
my $attachment = attachment_id_is_valid($attach_id);
-
- return ($attachment && $attachment->ispatch);
+ return ($attachment
+ && ($attachment->ispatch
+ || ($attachment->contenttype eq "text/x-github-pull-request" && $attachment->external_redirect)));
}
sub get_review_base {
@@ -103,7 +104,7 @@ sub get_review_link {
my $attachment = attachment_id_is_valid($attach_id);
- if ($attachment && $attachment->ispatch) {
+ if (attachment_id_is_patch($attach_id)) {
return "<a href='" . html_quote(get_review_url($attachment->bug, $attach_id)) .
"'>$link_text</a>";
}