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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8167dc61
Commit
8167dc61
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
56aa7f5a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
app/models/repository.rb
app/models/repository.rb
+1
-3
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+10
-0
No files found.
app/models/repository.rb
View file @
8167dc61
...
...
@@ -472,9 +472,7 @@ class Repository
end
def
blob_at
(
sha
,
path
)
unless
Gitlab
::
Git
.
blank_ref?
(
sha
)
Blob
.
decorate
(
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
),
project
)
end
Blob
.
decorate
(
raw_repository
.
blob_at
(
sha
,
path
),
project
)
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
nil
end
...
...
lib/gitlab/git/repository.rb
View file @
8167dc61
...
...
@@ -1082,6 +1082,16 @@ module Gitlab
@has_visible_content
=
has_local_branches?
end
def
fetch
(
remote
=
'origin'
)
args
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
fetch
#{
remote
}
)
popen
(
args
,
@path
).
last
.
zero?
end
def
blob_at
(
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
unless
Gitlab
::
Git
.
blank_ref?
(
sha
)
end
def
gitaly_repository
Gitlab
::
GitalyClient
::
Util
.
repository
(
@storage
,
@relative_path
,
@gl_repository
)
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