Continue refactoring. Use repostory and team
This commit is contained in:
parent
39ba934c0a
commit
dccd8b6eaa
42 changed files with 219 additions and 179 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue