summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-04-11 22:14:14 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-04-11 22:14:14 +0000
commit04a3e60e419ed1e7a8f253c7200703179a2177e1 (patch)
treef0e0ea7fd015755d326893694d40ccaf67899972 /lib
parent56034433ee12c07ef990cd0fad25a5c7af3c7a6b (diff)
parent543dcdacc2d4536ddeb1d88a7fa85e5fefed3f80 (diff)
downloadgitlab-ce-04a3e60e419ed1e7a8f253c7200703179a2177e1.tar.gz
Merge branch 'dm-outdated-diff-link' into 'master'
Link to outdated diff in older MR version from outdated diff discussion Closes #27865 See merge request !10572
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/diff/diff_refs.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/diff/diff_refs.rb b/lib/gitlab/diff/diff_refs.rb
index 8406ca4269c..7948782aecc 100644
--- a/lib/gitlab/diff/diff_refs.rb
+++ b/lib/gitlab/diff/diff_refs.rb
@@ -18,6 +18,12 @@ module Gitlab
head_sha == other.head_sha
end
+ alias_method :eql?, :==
+
+ def hash
+ [base_sha, start_sha, head_sha].hash
+ end
+
# There is only one case in which we will have `start_sha` and `head_sha`,
# but not `base_sha`, which is when a diff is generated between an
# orphaned branch and another branch, which means there _is_ no base, but