Update main calls to gitlab_git

This commit is contained in:
Dmitriy Zaporozhets 2013-08-05 16:51:04 +03:00
parent d602d5b1b0
commit b92655663c
5 changed files with 22 additions and 16 deletions

View file

@ -23,7 +23,7 @@ gem 'omniauth-github'
# Extracting information from a git repository
# 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
gem 'gitlab-grack', '~> 1.0.1', require: 'grack'

View file

@ -12,6 +12,14 @@ GIT
specs:
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
remote: https://rubygems.org/
specs:
@ -176,10 +184,6 @@ GEM
gitlab-pygments.rb (0.3.2)
posix-spawn (~> 0.3.6)
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_omniauth-ldap (1.0.3)
net-ldap (~> 0.3.1)
@ -275,7 +279,7 @@ GEM
minitest (4.7.4)
modernizr (2.6.2)
sprockets (~> 2.0)
multi_json (1.7.7)
multi_json (1.7.8)
multi_xml (0.5.4)
multipart-post (1.2.0)
mysql2 (0.3.11)
@ -568,7 +572,7 @@ DEPENDENCIES
gitlab-gollum-lib (~> 1.0.1)
gitlab-grack (~> 1.0.1)
gitlab-pygments.rb (~> 0.3.2)
gitlab_git (~> 1.4.1)
gitlab_git!
gitlab_meta (= 6.0)
gitlab_omniauth-ldap (= 1.0.3)
gon

View file

@ -137,7 +137,7 @@ class MergeRequest < ActiveRecord::Base
end
def unmerged_diffs
project.repository.diffs_between(source_branch, target_branch)
Gitlab::Git::Diff.between(project.repository, source_branch, target_branch)
end
def last_commit

View file

@ -18,19 +18,25 @@ class Repository
end
def commit(id = nil)
commit = raw_repository.commit(id)
commit = Gitlab::Git::Commit.find(raw_repository, id)
commit = Commit.new(commit) if commit
commit
end
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
end
def commits_between(target, source)
commits = raw_repository.commits_between(target, source)
def commits_between(from, to)
commits = Gitlab::Git::Commit.between(raw_repository, from, to)
commits = Commit.decorate(commits) if commits.present?
commits
end

View file

@ -95,13 +95,9 @@ module ExtractsPath
# resolved (e.g., when a user inserts an invalid path or ref).
def assign_ref_vars
@id = get_id
@ref, @path = extract_ref(@id)
@repo = @project.repository
@commit = @repo.commit(@ref)
@tree = Tree.new(@repo, @commit.id, @ref, @path)
@hex_path = Digest::SHA1.hexdigest(@path)
@logs_path = logs_file_project_ref_path(@project, @ref, @path)