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
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
Hide 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
...
...
@@ -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 @
16b8a1ef
...
...
@@ -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