Commit a20c237e0040752967c25f7e13cce62daf47c14c

  • Tree SHA1: c90b857
  • Parent SHA1: cd0cd0b (Add viewers list to sidebar in Edit collaborators page and refactor the permissions overview)
  • raw diff | raw patch
Find the repo to clone only once

Test failed, when the repo was found twice.

Signed-off-by: Marko Peltola <marko.peltola@jyu.fi>
app/controllers/repositories_controller.rb
(2 / 2)
  
9797 undef_method :clone
9898
9999 def clone
100 @repository_to_clone = @owner.repositories.find_by_name_in_project!(params[:id], @containing_project)
100 @repository_to_clone = @repository
101101 @root = Breadcrumb::CloneRepository.new(@repository_to_clone)
102102 unless @repository_to_clone.has_commits?
103103 flash[:error] = I18n.t "repositories_controller.new_clone_error"
108108 end
109109
110110 def create_clone
111 @repository_to_clone = @owner.repositories.find_by_name_in_project!(params[:id], @containing_project)
111 @repository_to_clone = @repository
112112 @root = Breadcrumb::CloneRepository.new(@repository_to_clone)
113113 unless @repository_to_clone.has_commits?
114114 respond_to do |format|