File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,11 @@ def reload_merge_request_diff
368
368
end
369
369
370
370
def merge_request_diff_for ( diff_refs )
371
- merge_request_diffs . viewable . select_without_diff . with_diff_refs ( diff_refs ) . take
371
+ @merge_request_diffs_by_diff_refs ||= Hash . new do |h , diff_refs |
372
+ h [ diff_refs ] = merge_request_diffs . viewable . select_without_diff . with_diff_refs ( diff_refs ) . take
373
+ end
374
+
375
+ @merge_request_diffs_by_diff_refs [ diff_refs ]
372
376
end
373
377
374
378
def reload_diff_if_branch_changed
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ def ==(other)
18
18
head_sha == other . head_sha
19
19
end
20
20
21
+ alias_method :eql? , :==
22
+
23
+ def hash
24
+ [ base_sha , start_sha , head_sha ] . hash
25
+ end
26
+
21
27
# There is only one case in which we will have `start_sha` and `head_sha`,
22
28
# but not `base_sha`, which is when a diff is generated between an
23
29
# orphaned branch and another branch, which means there _is_ no base, but
You can’t perform that action at this time.
0 commit comments