BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
baf12f45
Unverified
Commit
baf12f45
authored
Jul 01, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repository#blob_at should return nil for 00000000... sha
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
e934a62a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
repository.rb
app/models/repository.rb
+4
-2
repository_spec.rb
spec/models/repository_spec.rb
+8
-0
No files found.
app/models/repository.rb
View file @
baf12f45
...
...
@@ -8,7 +8,7 @@ class Repository
@project
=
project
if
path_with_namespace
@raw_repository
=
Gitlab
::
Git
::
Repository
.
new
(
path_to_repo
)
@raw_repository
=
Gitlab
::
Git
::
Repository
.
new
(
path_to_repo
)
@raw_repository
.
autocrlf
=
:input
end
...
...
@@ -173,7 +173,9 @@ class Repository
end
def
blob_at
(
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
unless
Gitlab
::
Git
.
blank_ref?
(
sha
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
end
end
def
blob_by_oid
(
oid
)
...
...
spec/models/repository_spec.rb
View file @
baf12f45
...
...
@@ -25,4 +25,12 @@ describe Repository do
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
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
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