diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/diff/diff_refs.rb | 2 | ||||
| -rw-r--r-- | lib/gitlab/git/repository.rb | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab/diff/diff_refs.rb b/lib/gitlab/diff/diff_refs.rb index d4823f60826..dc245377ccc 100644 --- a/lib/gitlab/diff/diff_refs.rb +++ b/lib/gitlab/diff/diff_refs.rb @@ -23,7 +23,7 @@ module Gitlab alias_method :eql?, :== def hash - [base_sha, start_sha, head_sha].hash + [self.class, base_sha, start_sha, head_sha].hash end # There is only one case in which we will have `start_sha` and `head_sha`, diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 067f4026f48..9b48031b2d3 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -80,7 +80,13 @@ module Gitlab end def ==(other) - [storage, relative_path] == [other.storage, other.relative_path] + other.is_a?(self.class) && [storage, relative_path] == [other.storage, other.relative_path] + end + + alias_method :eql?, :== + + def hash + [self.class, storage, relative_path].hash end # This method will be removed when Gitaly reaches v1.1. |
