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
Jérome Perrin
gitlab-ce
Commits
9cc15172
Commit
9cc15172
authored
Oct 06, 2017
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean hierarchy of calls between models and Gitalb::Git for blob search
parent
f72598b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/models/repository.rb
app/models/repository.rb
+1
-3
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+4
-0
No files found.
app/models/repository.rb
View file @
9cc15172
...
@@ -468,9 +468,7 @@ class Repository
...
@@ -468,9 +468,7 @@ class Repository
end
end
def
blob_at
(
sha
,
path
)
def
blob_at
(
sha
,
path
)
unless
Gitlab
::
Git
.
blank_ref?
(
sha
)
Blob
.
decorate
(
raw_repository
.
blob_at
(
sha
,
path
),
project
)
Blob
.
decorate
(
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
),
project
)
end
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
nil
nil
end
end
...
...
lib/gitlab/git/repository.rb
View file @
9cc15172
...
@@ -1092,6 +1092,10 @@ module Gitlab
...
@@ -1092,6 +1092,10 @@ module Gitlab
popen
(
args
,
@path
).
last
.
zero?
popen
(
args
,
@path
).
last
.
zero?
end
end
def
blob_at
(
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
unless
Gitlab
::
Git
.
blank_ref?
(
sha
)
end
def
gitaly_repository
def
gitaly_repository
Gitlab
::
GitalyClient
::
Util
.
repository
(
@storage
,
@relative_path
,
@gl_repository
)
Gitlab
::
GitalyClient
::
Util
.
repository
(
@storage
,
@relative_path
,
@gl_repository
)
end
end
...
...
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