Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
0601ce18
Commit
0601ce18
authored
Jun 20, 2016
by
Paco Guzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid instantiation of a Git::Tree
Only needed when the project view is ‘Files view’
parent
79fd3c7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+6
-1
No files found.
CHANGELOG
View file @
0601ce18
...
@@ -16,6 +16,7 @@ v 8.10.0 (unreleased)
...
@@ -16,6 +16,7 @@ v 8.10.0 (unreleased)
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- PipelinesFinder uses git cache data
- PipelinesFinder uses git cache data
- Check for conflicts with existing Project's wiki path when creating a new project.
- Check for conflicts with existing Project's wiki path when creating a new project.
- Don't instantiate a git tree on Projects show default view
- Remove unused front-end variable -> default_issues_tracker
- Remove unused front-end variable -> default_issues_tracker
- Add API endpoint for a group issues !4520 (mahcsig)
- Add API endpoint for a group issues !4520 (mahcsig)
- Add Bugzilla integration !4930 (iamtjg)
- Add Bugzilla integration !4930 (iamtjg)
...
...
app/controllers/projects_controller.rb
View file @
0601ce18
...
@@ -4,7 +4,8 @@ class ProjectsController < Projects::ApplicationController
...
@@ -4,7 +4,8 @@ class ProjectsController < Projects::ApplicationController
before_action
:authenticate_user!
,
except:
[
:show
,
:activity
,
:refs
]
before_action
:authenticate_user!
,
except:
[
:show
,
:activity
,
:refs
]
before_action
:project
,
except:
[
:new
,
:create
]
before_action
:project
,
except:
[
:new
,
:create
]
before_action
:repository
,
except:
[
:new
,
:create
]
before_action
:repository
,
except:
[
:new
,
:create
]
before_action
:assign_ref_vars
,
:tree
,
only:
[
:show
],
if: :repo_exists?
before_action
:assign_ref_vars
,
only:
[
:show
],
if: :repo_exists?
before_action
:tree
,
only:
[
:show
],
if: :project_view_files?
# Authorize
# Authorize
before_action
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:housekeeping
,
:download_export
,
:export
,
:remove_export
,
:generate_new_export
]
before_action
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:housekeeping
,
:download_export
,
:export
,
:remove_export
,
:generate_new_export
]
...
@@ -303,6 +304,10 @@ class ProjectsController < Projects::ApplicationController
...
@@ -303,6 +304,10 @@ class ProjectsController < Projects::ApplicationController
project
.
repository_exists?
&&
!
project
.
empty_repo?
project
.
repository_exists?
&&
!
project
.
empty_repo?
end
end
def
project_view_files?
current_user
&&
current_user
.
project_view
==
'files'
end
# Override extract_ref from ExtractsPath, which returns the branch and file path
# Override extract_ref from ExtractsPath, which returns the branch and file path
# for the blob/tree, which in this case is just the root of the default branch.
# for the blob/tree, which in this case is just the root of the default branch.
# This way we avoid to access the repository.ref_names.
# This way we avoid to access the repository.ref_names.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment