Continue refactoring. Use repostory and team
This commit is contained in:
parent
39ba934c0a
commit
dccd8b6eaa
42 changed files with 219 additions and 179 deletions
|
@ -82,7 +82,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def destroy_project(project)
|
||||
FileUtils.rm_rf(project.path_to_repo)
|
||||
FileUtils.rm_rf(project.repository.path_to_repo)
|
||||
conf.rm_repo(project.path_with_namespace)
|
||||
end
|
||||
|
||||
|
@ -138,9 +138,9 @@ module Gitlab
|
|||
::Gitolite::Config::Repo.new(repo_name)
|
||||
end
|
||||
|
||||
name_readers = project.repository_readers
|
||||
name_writers = project.repository_writers
|
||||
name_masters = project.repository_masters
|
||||
name_readers = project.team.repository_readers
|
||||
name_writers = project.team.repository_writers
|
||||
name_masters = project.team.repository_masters
|
||||
|
||||
pr_br = project.protected_branches.map(&:name).join("$ ")
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def reference_commit(identifier)
|
||||
if @project.valid_repo? && commit = @project.commit(identifier)
|
||||
if @project.valid_repo? && commit = @project.repository.commit(identifier)
|
||||
link_to(identifier, project_commit_path(@project, commit), html_options.merge(title: CommitDecorator.new(commit).link_title, class: "gfm gfm-commit #{html_options[:class]}"))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@ module Gitlab
|
|||
merge_repo.git.push({raise: true, timeout: true}, :origin, merge_request.target_branch)
|
||||
|
||||
# remove source branch
|
||||
if merge_request.should_remove_source_branch && !project.root_ref?(merge_request.source_branch)
|
||||
if merge_request.should_remove_source_branch && !project.repository.root_ref?(merge_request.source_branch)
|
||||
# will raise CommandFailed when push fails
|
||||
merge_repo.git.push({raise: true, timeout: true}, :origin, ":#{merge_request.source_branch}")
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue