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
6d3eea7b
Commit
6d3eea7b
authored
Oct 11, 2017
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if the branch/tag count is over a certain limit, don't execute
the long running git query
parent
a11077e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/controllers/projects/commit_controller.rb
app/controllers/projects/commit_controller.rb
+2
-2
app/models/repository.rb
app/models/repository.rb
+4
-4
No files found.
app/controllers/projects/commit_controller.rb
View file @
6d3eea7b
...
...
@@ -56,8 +56,8 @@ class Projects::CommitController < Projects::ApplicationController
end
def
branches
@branches
=
@project
.
repository
.
branch_names_contains
(
commit
.
id
)
@tags
=
@project
.
repository
.
tag_names_contains
(
commit
.
id
)
@branches
=
@project
.
repository
.
branch_names_contains
(
commit
.
id
,
1000
)
@tags
=
@project
.
repository
.
tag_names_contains
(
commit
.
id
,
1000
)
render
layout:
false
end
...
...
app/models/repository.rb
View file @
6d3eea7b
...
...
@@ -715,12 +715,12 @@ class Repository
end
end
def
branch_names_contains
(
sha
)
refs_contains_sha
(
'branch'
,
sha
)
def
branch_names_contains
(
sha
,
limit
=
nil
)
limit
&&
branch_count
>
limit
?
[]
:
refs_contains_sha
(
'branch'
,
sha
)
end
def
tag_names_contains
(
sha
)
refs_contains_sha
(
'tag'
,
sha
)
def
tag_names_contains
(
sha
,
limit
=
nil
)
limit
&&
tag_count
>
limit
?
[]
:
refs_contains_sha
(
'tag'
,
sha
)
end
def
local_branches
...
...
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