Skip to content

Commit

Permalink
Make max tree size configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
lildude authored Dec 14, 2023
1 parent ee9119e commit ebf7ee2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/linguist/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ def current_tree
end

protected
MAX_TREE_SIZE = 100_000

def compute_stats(old_commit_oid, cache = nil)
return {} if current_tree.count_recursive(MAX_TREE_SIZE) >= MAX_TREE_SIZE
def compute_stats(old_commit_oid, cache = nil, max_tree_size = 100_000)
return {} if current_tree.count_recursive(max_tree_size) >= max_tree_size

old_tree = old_commit_oid && Rugged::Commit.lookup(repository, old_commit_oid).tree
read_index
Expand Down

0 comments on commit ebf7ee2

Please sign in to comment.