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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
cd814fbc
Commit
cd814fbc
authored
Aug 17, 2016
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate unneeded calls to Repository#blob_at when listing commits with no path
parent
83bbca26
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
CHANGELOG
CHANGELOG
+1
-0
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+24
-21
No files found.
CHANGELOG
View file @
cd814fbc
...
@@ -120,6 +120,7 @@ v 8.11.0 (unreleased)
...
@@ -120,6 +120,7 @@ v 8.11.0 (unreleased)
- Fix a memory leak caused by Banzai::Filter::SanitizationFilter
- Fix a memory leak caused by Banzai::Filter::SanitizationFilter
- Speed up todos queries by limiting the projects set we join with
- Speed up todos queries by limiting the projects set we join with
- Ensure file editing in UI does not overwrite commited changes without warning user
- Ensure file editing in UI does not overwrite commited changes without warning user
- Eliminate unneeded calls to Repository#blob_at when listing commits with no path
v 8.10.6
v 8.10.6
- Upgrade Rails to 4.2.7.1 for security fixes. !5781
- Upgrade Rails to 4.2.7.1 for security fixes. !5781
...
...
app/helpers/commits_helper.rb
View file @
cd814fbc
...
@@ -98,7 +98,16 @@ module CommitsHelper
...
@@ -98,7 +98,16 @@ module CommitsHelper
end
end
def
link_to_browse_code
(
project
,
commit
)
def
link_to_browse_code
(
project
,
commit
)
if
current_controller?
(
:projects
,
:commits
)
if
@path
.
blank?
return
link_to
(
"Browse Files"
,
namespace_project_tree_path
(
project
.
namespace
,
project
,
commit
),
class:
"btn btn-default"
)
end
return
unless
current_controller?
(
:projects
,
:commits
)
if
@repo
.
blob_at
(
commit
.
id
,
@path
)
if
@repo
.
blob_at
(
commit
.
id
,
@path
)
return
link_to
(
return
link_to
(
"Browse File"
,
"Browse File"
,
...
@@ -115,12 +124,6 @@ module CommitsHelper
...
@@ -115,12 +124,6 @@ module CommitsHelper
)
)
end
end
end
end
link_to
(
"Browse Files"
,
namespace_project_tree_path
(
project
.
namespace
,
project
,
commit
),
class:
"btn btn-default"
)
end
def
revert_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
,
has_tooltip:
true
)
def
revert_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
,
has_tooltip:
true
)
return
unless
current_user
return
unless
current_user
...
...
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