summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-01 14:18:51 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 07:39:15 +0100
commitcd0f19450843b5b9245ae82302d3f9d9003cb899 (patch)
treee314a1b4b4791f75fb187be580999fc2969afbf2 /lib
parent9124ebce982981b74ae644793a680b2b6060ce21 (diff)
downloadgitlab-ce-cd0f19450843b5b9245ae82302d3f9d9003cb899.tar.gz
Do not unfold non-referables when moving an issue
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/reference_unfold_filter.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/banzai/filter/reference_unfold_filter.rb b/lib/banzai/filter/reference_unfold_filter.rb
index d8ed44a0e4e..70a485ba2ae 100644
--- a/lib/banzai/filter/reference_unfold_filter.rb
+++ b/lib/banzai/filter/reference_unfold_filter.rb
@@ -21,6 +21,8 @@ module Banzai
def call
@referables.each do |referable|
+ next unless referable.respond_to?(:to_reference)
+
pattern = /#{Regexp.escape(referable.to_reference)}/
@text.gsub!(pattern, referable.to_reference(@new_project))
end