summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff/file_collection
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-21 15:38:33 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-23 16:27:30 -0500
commitab91f76e8b275d0fc1d78b38b95d4b2cd8e73bdb (patch)
treee22910b5a3fc8dee98c5d674ee030b46421a4727 /lib/gitlab/diff/file_collection
parent52527be4387cb978402a330f2e4de96e586a62db (diff)
downloadgitlab-ce-ab91f76e8b275d0fc1d78b38b95d4b2cd8e73bdb.tar.gz
Add system note with link to diff comparison when MR discussion becomes outdated
Diffstat (limited to 'lib/gitlab/diff/file_collection')
-rw-r--r--lib/gitlab/diff/file_collection/base.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/diff/file_collection/base.rb b/lib/gitlab/diff/file_collection/base.rb
index 2b9fc65b985..7c32adc6ce7 100644
--- a/lib/gitlab/diff/file_collection/base.rb
+++ b/lib/gitlab/diff/file_collection/base.rb
@@ -24,6 +24,14 @@ module Gitlab
@diff_files ||= @diffs.decorate! { |diff| decorate_diff!(diff) }
end
+ def diff_file_with_old_path(old_path)
+ diff_files.find { |diff_file| diff_file.old_path == old_path }
+ end
+
+ def diff_file_with_new_path(new_path)
+ diff_files.find { |diff_file| diff_file.new_path == new_path }
+ end
+
private
def decorate_diff!(diff)