Commit b9265566 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Update main calls to gitlab_git

parent d602d5b1
...@@ -23,7 +23,7 @@ gem 'omniauth-github' ...@@ -23,7 +23,7 @@ gem 'omniauth-github'
# Extracting information from a git repository # Extracting information from a git repository
# Provide access to Gitlab::Git library # Provide access to Gitlab::Git library
gem 'gitlab_git', '~> 1.4.1' gem 'gitlab_git', path: '../gitlab_git'#'~> 1.4.1'
# Ruby/Rack Git Smart-HTTP Server Handler # Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 1.0.1', require: 'grack' gem 'gitlab-grack', '~> 1.0.1', require: 'grack'
......
...@@ -12,6 +12,14 @@ GIT ...@@ -12,6 +12,14 @@ GIT
specs: specs:
raphael-rails (2.1.0) raphael-rails (2.1.0)
PATH
remote: ../gitlab_git
specs:
gitlab_git (1.4.1)
activesupport (~> 3.2.13)
github-linguist (~> 2.3.4)
gitlab-grit (~> 2.6.0)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
...@@ -176,10 +184,6 @@ GEM ...@@ -176,10 +184,6 @@ GEM
gitlab-pygments.rb (0.3.2) gitlab-pygments.rb (0.3.2)
posix-spawn (~> 0.3.6) posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0) yajl-ruby (~> 1.1.0)
gitlab_git (1.4.1)
activesupport (~> 3.2.13)
github-linguist (~> 2.3.4)
gitlab-grit (~> 2.6.0)
gitlab_meta (6.0) gitlab_meta (6.0)
gitlab_omniauth-ldap (1.0.3) gitlab_omniauth-ldap (1.0.3)
net-ldap (~> 0.3.1) net-ldap (~> 0.3.1)
...@@ -275,7 +279,7 @@ GEM ...@@ -275,7 +279,7 @@ GEM
minitest (4.7.4) minitest (4.7.4)
modernizr (2.6.2) modernizr (2.6.2)
sprockets (~> 2.0) sprockets (~> 2.0)
multi_json (1.7.7) multi_json (1.7.8)
multi_xml (0.5.4) multi_xml (0.5.4)
multipart-post (1.2.0) multipart-post (1.2.0)
mysql2 (0.3.11) mysql2 (0.3.11)
...@@ -568,7 +572,7 @@ DEPENDENCIES ...@@ -568,7 +572,7 @@ DEPENDENCIES
gitlab-gollum-lib (~> 1.0.1) gitlab-gollum-lib (~> 1.0.1)
gitlab-grack (~> 1.0.1) gitlab-grack (~> 1.0.1)
gitlab-pygments.rb (~> 0.3.2) gitlab-pygments.rb (~> 0.3.2)
gitlab_git (~> 1.4.1) gitlab_git!
gitlab_meta (= 6.0) gitlab_meta (= 6.0)
gitlab_omniauth-ldap (= 1.0.3) gitlab_omniauth-ldap (= 1.0.3)
gon gon
......
...@@ -137,7 +137,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -137,7 +137,7 @@ class MergeRequest < ActiveRecord::Base
end end
def unmerged_diffs def unmerged_diffs
project.repository.diffs_between(source_branch, target_branch) Gitlab::Git::Diff.between(project.repository, source_branch, target_branch)
end end
def last_commit def last_commit
......
...@@ -18,19 +18,25 @@ class Repository ...@@ -18,19 +18,25 @@ class Repository
end end
def commit(id = nil) def commit(id = nil)
commit = raw_repository.commit(id) commit = Gitlab::Git::Commit.find(raw_repository, id)
commit = Commit.new(commit) if commit commit = Commit.new(commit) if commit
commit commit
end end
def commits(ref, path = nil, limit = nil, offset = nil) def commits(ref, path = nil, limit = nil, offset = nil)
commits = raw_repository.commits(ref, path, limit, offset) commits = Gitlab::Git::Commit.where(
repo: raw_repository,
ref: ref,
path: path,
limit: limit,
offset: offset,
)
commits = Commit.decorate(commits) if commits.present? commits = Commit.decorate(commits) if commits.present?
commits commits
end end
def commits_between(target, source) def commits_between(from, to)
commits = raw_repository.commits_between(target, source) commits = Gitlab::Git::Commit.between(raw_repository, from, to)
commits = Commit.decorate(commits) if commits.present? commits = Commit.decorate(commits) if commits.present?
commits commits
end end
......
...@@ -95,13 +95,9 @@ module ExtractsPath ...@@ -95,13 +95,9 @@ module ExtractsPath
# resolved (e.g., when a user inserts an invalid path or ref). # resolved (e.g., when a user inserts an invalid path or ref).
def assign_ref_vars def assign_ref_vars
@id = get_id @id = get_id
@ref, @path = extract_ref(@id) @ref, @path = extract_ref(@id)
@repo = @project.repository @repo = @project.repository
@commit = @repo.commit(@ref) @commit = @repo.commit(@ref)
@tree = Tree.new(@repo, @commit.id, @ref, @path) @tree = Tree.new(@repo, @commit.id, @ref, @path)
@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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment