Commit 6d3eea7b authored by Brett Walker's avatar Brett Walker
Browse files

if the branch/tag count is over a certain limit, don't execute

the long running git query
parent a11077e9
...@@ -56,8 +56,8 @@ def pipelines ...@@ -56,8 +56,8 @@ def pipelines
end end
def branches def branches
@branches = @project.repository.branch_names_contains(commit.id) @branches = @project.repository.branch_names_contains(commit.id, 1000)
@tags = @project.repository.tag_names_contains(commit.id) @tags = @project.repository.tag_names_contains(commit.id, 1000)
render layout: false render layout: false
end end
......
...@@ -715,12 +715,12 @@ def refs_contains_sha(ref_type, sha) ...@@ -715,12 +715,12 @@ def refs_contains_sha(ref_type, sha)
end end
end end
def branch_names_contains(sha) def branch_names_contains(sha, limit = nil)
refs_contains_sha('branch', sha) limit && branch_count > limit ? [] : refs_contains_sha('branch', sha)
end end
def tag_names_contains(sha) def tag_names_contains(sha, limit = nil)
refs_contains_sha('tag', sha) limit && tag_count > limit ? [] : refs_contains_sha('tag', sha)
end end
def local_branches def local_branches
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment