diff options
-rw-r--r-- | app/controllers/projects_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c81c7ea59c2..bb2df275b77 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -5,7 +5,7 @@ class ProjectsController < ApplicationController skip_before_action :authenticate_user!, only: [:show, :activity] before_action :project, except: [:new, :create] before_action :repository, except: [:new, :create] - before_action :assign_ref_vars, :tree, only: [:show] + before_action :assign_ref_vars, :tree, only: [:show], if: :repo_exists? # Authorize before_action :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive] @@ -229,6 +229,10 @@ class ProjectsController < ApplicationController render "go_import", layout: false end + def repo_exists? + project.repository_exists? && !project.empty_repo? + end + def get_id project.repository.root_ref end |