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
Boxiang Sun
gitlab-ce
Commits
1d3f03fb
Commit
1d3f03fb
authored
Oct 01, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix blob and repo stuff after gitlab_git v3
parent
836c870c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
10 deletions
+19
-10
app/assets/stylesheets/gitlab_bootstrap/files.scss
app/assets/stylesheets/gitlab_bootstrap/files.scss
+6
-0
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+2
-0
app/models/repository.rb
app/models/repository.rb
+1
-1
app/views/projects/blob/_download.html.haml
app/views/projects/blob/_download.html.haml
+5
-6
lib/api/repositories.rb
lib/api/repositories.rb
+3
-3
lib/extracts_path.rb
lib/extracts_path.rb
+2
-0
No files found.
app/assets/stylesheets/gitlab_bootstrap/files.scss
View file @
1d3f03fb
...
@@ -69,6 +69,12 @@
...
@@ -69,6 +69,12 @@
}
}
&
.blob-no-preview
{
background
:
#eee
;
text-shadow
:
0
1px
2px
#FFF
;
padding
:
100px
0
;
}
/**
/**
* Blame file
* Blame file
*/
*/
...
...
app/controllers/projects/blob_controller.rb
View file @
1d3f03fb
...
@@ -9,5 +9,7 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -9,5 +9,7 @@ class Projects::BlobController < Projects::ApplicationController
def
show
def
show
@blob
=
Gitlab
::
Git
::
Blob
.
find
(
@repository
,
@commit
.
id
,
@path
)
@blob
=
Gitlab
::
Git
::
Blob
.
find
(
@repository
,
@commit
.
id
,
@path
)
not_found!
unless
@blob
end
end
end
end
app/models/repository.rb
View file @
1d3f03fb
...
@@ -5,7 +5,7 @@ class Repository
...
@@ -5,7 +5,7 @@ class Repository
def
initialize
(
path_with_namespace
,
default_branch
)
def
initialize
(
path_with_namespace
,
default_branch
)
@path_with_namespace
=
path_with_namespace
@path_with_namespace
=
path_with_namespace
@raw_repository
=
Gitlab
::
Git
::
Repository
.
new
(
path_to_repo
)
@raw_repository
=
Gitlab
::
Git
::
Repository
.
new
(
path_to_repo
)
if
path_with_namespace
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
nil
nil
end
end
...
...
app/views/projects/blob/_download.html.haml
View file @
1d3f03fb
.file-content.blob_file
.file-content.blob_file
.blob-no-preview
%center
%center
=
link_to
project_raw_path
(
@project
,
@id
)
do
=
link_to
project_raw_path
(
@project
,
@id
)
do
%div
.padded
%h1
.light
%h4
%i
.icon-download-alt
%i
.icon-download-alt
%h4
%br
Download (
#{
number_to_human_size
blob
.
size
}
)
Download (
#{
number_to_human_size
blob
.
size
}
)
lib/api/repositories.rb
View file @
1d3f03fb
...
@@ -139,7 +139,7 @@ module API
...
@@ -139,7 +139,7 @@ module API
path
=
params
[
:path
]
||
nil
path
=
params
[
:path
]
||
nil
commit
=
user_project
.
repository
.
commit
(
ref
)
commit
=
user_project
.
repository
.
commit
(
ref
)
tree
=
Tree
.
new
(
user_project
.
repository
,
commit
.
id
,
ref
,
path
)
tree
=
Tree
.
new
(
user_project
.
repository
,
commit
.
id
,
path
)
trees
=
[]
trees
=
[]
...
@@ -168,8 +168,8 @@ module API
...
@@ -168,8 +168,8 @@ module API
commit
=
repo
.
commit
(
ref
)
commit
=
repo
.
commit
(
ref
)
not_found!
"Commit"
unless
commit
not_found!
"Commit"
unless
commit
blob
=
Gitlab
::
Git
::
Blob
.
new
(
repo
,
commit
.
id
,
ref
,
params
[
:filepath
])
blob
=
Gitlab
::
Git
::
Blob
.
find
(
repo
,
commit
.
id
,
params
[
:filepath
])
not_found!
"File"
unless
blob
.
exists?
not_found!
"File"
unless
blob
env
[
'api.format'
]
=
:txt
env
[
'api.format'
]
=
:txt
...
...
lib/extracts_path.rb
View file @
1d3f03fb
...
@@ -107,6 +107,8 @@ module ExtractsPath
...
@@ -107,6 +107,8 @@ module ExtractsPath
@commit
=
@repo
.
commit
(
@options
[
:extended_sha1
])
@commit
=
@repo
.
commit
(
@options
[
:extended_sha1
])
end
end
raise
InvalidPathError
unless
@commit
@hex_path
=
Digest
::
SHA1
.
hexdigest
(
@path
)
@hex_path
=
Digest
::
SHA1
.
hexdigest
(
@path
)
@logs_path
=
logs_file_project_ref_path
(
@project
,
@ref
,
@path
)
@logs_path
=
logs_file_project_ref_path
(
@project
,
@ref
,
@path
)
...
...
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