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
6 years ago
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
Show 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
...
...
This diff is collapsed.
Click to expand it.
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`,
...
...
This diff is collapsed.
Click to expand it.
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.
...
...
This diff is collapsed.
Click to expand it.
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