Continue refactoring. Use repostory and team

This commit is contained in:
Dmitriy Zaporozhets 2013-01-04 08:43:25 +02:00
parent 39ba934c0a
commit dccd8b6eaa
42 changed files with 219 additions and 179 deletions

View file

@ -13,9 +13,11 @@ class Repository
attr_accessor :root_ref
def initialize(path_with_namespace, root_ref = 'master')
@root_ref = root_ref
@root_ref = root_ref || "master"
@path_with_namespace = path_with_namespace
@repo = Grit::Repo.new(path_to_repo)
# Init grit repo object
repo
end
def raw
@ -26,6 +28,10 @@ class Repository
@path_to_repo ||= File.join(Gitlab.config.gitolite.repos_path, "#{path_with_namespace}.git")
end
def repo
@repo ||= Grit::Repo.new(path_to_repo)
end
def commit(commit_id = nil)
Commit.find_or_first(repo, commit_id, root_ref)
end
@ -114,7 +120,7 @@ class Repository
false
end
def empty_repo?
def empty?
!has_commits?
end