Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4b7e9eaa
Commit
4b7e9eaa
authored
Nov 23, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Treat Repository instances with the same disk path as the same hash key
parent
5f0e4040
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
app/models/repository.rb
app/models/repository.rb
+7
-1
lib/gitlab/diff/diff_refs.rb
lib/gitlab/diff/diff_refs.rb
+1
-1
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+7
-1
No files found.
app/models/repository.rb
View file @
4b7e9eaa
...
...
@@ -69,7 +69,13 @@ class Repository
end
def
==
(
other
)
@disk_path
==
other
.
disk_path
other
.
is_a?
(
self
.
class
)
&&
@disk_path
==
other
.
disk_path
end
alias_method
:eql?
,
:==
def
hash
[
self
.
class
,
@disk_path
].
hash
end
def
raw_repository
...
...
lib/gitlab/diff/diff_refs.rb
View file @
4b7e9eaa
...
...
@@ -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`,
...
...
lib/gitlab/git/repository.rb
View file @
4b7e9eaa
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment