diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-01 18:26:55 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-01 18:26:55 +0300 |
commit | 1d3f03fb69111e25a33ccb7f66582904ad0371f8 (patch) | |
tree | 57e16cc0e7dc0f05cbee202ca0d6fd8a7b82b591 /lib | |
parent | 836c870cc9f72449befd03c994f563040ff94f69 (diff) | |
download | gitlab-ce-1d3f03fb69111e25a33ccb7f66582904ad0371f8.tar.gz |
Fix blob and repo stuff after gitlab_git v3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/repositories.rb | 6 | ||||
-rw-r--r-- | lib/extracts_path.rb | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index c2b229b0172..1a911eae2bb 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -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 = [] @@ -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 diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index 5f28d624402..6e7872dcd03 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -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) |