Skip to content
Snippets Groups Projects
Commit d322bfae authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets Committed by Wes Gurney
Browse files

Fix blob and repo stuff after gitlab_git v3

parent 9cc498a6
No related branches found
No related tags found
1 merge request!4954Add support to configure webhook_timeout in gitlab.yaml
This commit is part of merge request !4954. Comments created here will be created in the context of that merge request.
Loading
Loading
@@ -69,6 +69,12 @@
 
}
 
&.blob-no-preview {
background: #eee;
text-shadow: 0 1px 2px #FFF;
padding: 100px 0;
}
/**
* Blame file
*/
Loading
Loading
Loading
Loading
@@ -9,5 +9,7 @@ class Projects::BlobController < Projects::ApplicationController
 
def show
@blob = Gitlab::Git::Blob.find(@repository, @commit.id, @path)
not_found! unless @blob
end
end
Loading
Loading
@@ -5,7 +5,7 @@ class Repository
 
def initialize(path_with_namespace, default_branch)
@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
nil
end
Loading
Loading
.file-content.blob_file
.file-content.blob_file.blob-no-preview
%center
= link_to project_raw_path(@project, @id) do
%div.padded
%h4
%i.icon-download-alt
%br
Download (#{number_to_human_size blob.size})
%h1.light
%i.icon-download-alt
%h4
Download (#{number_to_human_size blob.size})
Loading
Loading
@@ -139,7 +139,7 @@ module API
path = params[:path] || nil
 
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 = []
 
Loading
Loading
@@ -168,8 +168,8 @@ module API
commit = repo.commit(ref)
not_found! "Commit" unless commit
 
blob = Gitlab::Git::Blob.new(repo, commit.id, ref, params[:filepath])
not_found! "File" unless blob.exists?
blob = Gitlab::Git::Blob.find(repo, commit.id, params[:filepath])
not_found! "File" unless blob
 
env['api.format'] = :txt
 
Loading
Loading
Loading
Loading
@@ -107,6 +107,8 @@ module ExtractsPath
@commit = @repo.commit(@options[:extended_sha1])
end
 
raise InvalidPathError unless @commit
@hex_path = Digest::SHA1.hexdigest(@path)
@logs_path = logs_file_project_ref_path(@project, @ref, @path)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment