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
Kazuhiko Shiozaki
gitlab-ce
Commits
16b8a1ef
Commit
16b8a1ef
authored
Jul 01, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
690aafeb
2d85458a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
app/models/repository.rb
app/models/repository.rb
+4
-2
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+8
-0
No files found.
app/models/repository.rb
View file @
16b8a1ef
...
@@ -173,8 +173,10 @@ class Repository
...
@@ -173,8 +173,10 @@ class Repository
end
end
def
blob_at
(
sha
,
path
)
def
blob_at
(
sha
,
path
)
unless
Gitlab
::
Git
.
blank_ref?
(
sha
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
end
end
end
def
blob_by_oid
(
oid
)
def
blob_by_oid
(
oid
)
Gitlab
::
Git
::
Blob
.
raw
(
self
,
oid
)
Gitlab
::
Git
::
Blob
.
raw
(
self
,
oid
)
...
...
spec/models/repository_spec.rb
View file @
16b8a1ef
...
@@ -25,4 +25,12 @@ describe Repository do
...
@@ -25,4 +25,12 @@ describe Repository do
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
end
end
describe
:blob_at
do
context
'blank sha'
do
subject
{
repository
.
blob_at
(
Gitlab
::
Git
::
BLANK_SHA
,
'.gitignore'
)
}
it
{
is_expected
.
to
be_nil
}
end
end
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